R. David Murray added the comment:

No, the workaround was for duplicating the existing behavior if the fix 
(raising an error like a normal dict does) broken someone's code.  The *only* 
possibility here is to have a __reversed__ that raises a TypeError.

What is it that makes reversed raise a typeerror on dict here?  Not that we can 
change it at this point, but reversed blindly using len and __getitem__ for 
user classes but not on dict is rather inconsistent.  I suppose the dict 
TypeError special case catches common mistakes?  In which case adding a 
__reversed__ that raises a TypeError to Mapping seems to make sense for the 
same reason.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25864>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to