[issue19995] hex() and %x, oct() and %o do not behave the same

Ethan Furman report at bugs.python.org
Mon Dec 16 21:20:58 CET 2013


Ethan Furman added the comment:

Eric V. Smith commented:
------------------------
> If you were going to make this change, I'd think you'd have to look
> for __index__ and then __int__.

Does the order matter?  Are there any types (and should there be) that would have both and return different answers for each?

If not, pick an order, try one and, if that one fails, try the other.

----------

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


More information about the Python-bugs-list mailing list