New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hexadecimal id in reprs #66230
Comments
Default repr of an instance looks as: >>> object()
<object object at 0xb71a14a8> Many specialized reprs follow a pattern <... at {hexadecimal id}...>. But there are few deviations:
Proposed patch makes these cases to conform with other reprs. |
The patch looks good to me. |
New changeset 4cef7b0ec659 by Serhiy Storchaka in branch 'default': |
Thanks Victor. Applied only in default because this issue is too minor. |
I oppose making this change. The exact format of this generic repr of Changing the repr risks breaking doctests. That *might* be acceptable if |
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).
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 :-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: