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

Antoine Pitrou report at bugs.python.org
Mon Dec 16 22:26:27 CET 2013


Antoine Pitrou added the comment:

> In other words
> 
>   - if %d or %u is specified, try __int__, then __index__
>     (according to the docs, u is obsolete and identical to d)

Again, I don't think trying __index__ is useful.

>   - if %i, %o, %x, %X, or %c is specified, try only __index__

I think everything yielding a decimal output should work with floats
(i.e. %i too).

----------

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


More information about the Python-bugs-list mailing list