[issue16694] Add pure Python operator module

Serhiy Storchaka report at bugs.python.org
Thu Dec 20 12:42:51 CET 2012


Serhiy Storchaka added the comment:

Sorry, I forgot push a "Publish All My Drafts" button. Please consider other my comments to first patch. I also have added new comments about length_hint().

Your implementation of attrgetter() looks good. One possible disadvantage of pure functional approach is that attrgetter() will be not a class. Unlikely someone subclass attrgetter, but it can be used in an isinstance() check. You solve this issue.

The same approach can be applied to itemgetter().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16694>
_______________________________________


More information about the Python-bugs-list mailing list