[issue27260] Missing equality check for super objects

Jelle Zijlstra report at bugs.python.org
Wed Jun 8 01:10:28 EDT 2016


Jelle Zijlstra added the comment:

This came up as part of a static analysis script that compares sets of method calls, including calls to methods on super(). The check was giving incorrect results because identical super() objects were comparing as different.

super() is documented (https://docs.python.org/3/library/functions.html#super) as only delegating lookups for explicit attribute lookups, not for implicit lookups like that done by the == operator, so I think it would be safe to override tp_richcompare in C on super objects. In writing my patch, I'll be sure to test that the code you gave still works correctly though.

----------

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


More information about the Python-bugs-list mailing list