[issue22031] Hexadecimal id in reprs

STINNER Victor report at bugs.python.org
Tue Jul 22 13:52:11 CEST 2014


STINNER Victor added the comment:

> Changing the repr risks breaking doctests.

That's why the change was only done in Python 3.5. To port your application to Python 3.5, you can modify you doctests to use "..." (ellipsis option of doctests).

> That *might* be acceptable if there was some obvious benefit
> to the change,

It's better to have consistent representation of objects. Low-level debuggers like gdb uses hexadecimal, not decimal. I'm regulary using gdb, and having the memory address in hexadecimal helps.

By the way, you should never rely on the (exact) representation in your unit tests :-)

----------

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


More information about the Python-bugs-list mailing list