This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients ncoghlan, python-dev, rhettinger, serhiy.storchaka
Date 2015-01-04.02:39:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks Serhiy.  I really like this clean-up.  When there is an exception in the user's root comparison operation, the traceback is more intelligible now.

If you're interested, here are two additional optimizations:

_op_or_eq = '''                                                 
    op_result = self.%s(other)
    # Since bool(NotImplemented) is true, the usual special case test isn't needed here
    return op_result or self == other                           

# setting NotImplemented as a local constant saves one or two global lookups per call
exec('def %s(self, other, NotImplemented=NotImplemented):%s' % (opname, opfunc % root), namespace)
Date User Action Args
2015-01-04 05:39:22rhettingerunlinkissue23132 messages
2015-01-04 02:39:13rhettingersetrecipients: + rhettinger, ncoghlan, python-dev, serhiy.storchaka
2015-01-04 02:39:12rhettingersetmessageid: <>
2015-01-04 02:39:12rhettingerlinkissue23132 messages
2015-01-04 02:39:11rhettingercreate