Nick Coghlan wrote:
On Thu, Feb 23, 2012 at 8:12 PM, Mark Shannon <m...@hotpy.org> wrote:
Should exceptions raised in the equality test be converted to a NameError or
just propogated?

Our general trend has been towards letting such exceptions escape the
operation that caused them rather than implicitly suppressing them. In
this case, the NameError message that results is also misleading
(since "print(globals().keys())" will definitely show an 'a' entry).

Given the effort you have to go to to trigger it, I'd consider fixing
this low priority, but I agree that the conversion of the TypeError to
NameError is a bug (likely resolved by adding a KeyError exception
type check in the appropriate location).

It is not a difficult fix. Just replacing calls to PyDict_GetItem with PyDict_GetItemWithError and raising NameError only if no Exception has occurred.

Cheers,
Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to