[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

Ethan Furman report at bugs.python.org
Sat Dec 28 21:23:56 CET 2013


Ethan Furman added the comment:

True.  I meant similar in that Python will use what's available to fill in the blank:

  class has __eq__ but user tried != ?  use __eq__ and invert result

  class has __index__ but user tried int() ?  use __index__ as-is

----------

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


More information about the Python-bugs-list mailing list