[issue3828] Bound methods compare 'successfully' with ints

Amaury Forgeot d'Arc report at bugs.python.org
Wed Sep 10 17:20:15 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

You are right. And thanks to the time machine, python 3.0 already forbid
such comparisons:

>>> a.b < 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: method() < int()

The behaviour cannot change for the 2.x series, though - it would break
backward compatibility. python2.6 however has a "-3" option that prints
a warning in this case:

>>> a.b < 0
__main__:1: DeprecationWarning: comparing unequal types not supported in 3.x

----------
nosy: +amaury.forgeotdarc
resolution:  -> works for me
status: open -> closed

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


More information about the Python-bugs-list mailing list