This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Redundant id in informative reprs
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, serhiy.storchaka, yselivanov
Priority: normal Keywords:

Created on 2015-05-15 06:24 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg243247 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-05-15 06:24
>>> import inspect
>>> def foo(a, *, b=10): pass
... 
>>> inspect.signature(foo)
<Signature at 0xb6e2768c "(a, *, b=10)">

I think the id is not needed in informative repr if you implemented __eq__. Identity doesn't matter if different instances can be equal. The id in the repr only adds a noise.
msg243279 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-15 16:43
Agree. Let's remove them. I'll update the code.
msg243280 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-15 16:54
New changeset d72d31f4b69a by Yury Selivanov in branch 'default':
inspect: Remove "0x..." IDs from Signature objects' __repr__
https://hg.python.org/cpython/rev/d72d31f4b69a
msg243282 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-15 16:55
New changeset f23d0a4278aa by Yury Selivanov in branch 'default':
Issue 24200: Fix broken unittest.
https://hg.python.org/cpython/rev/f23d0a4278aa
History
Date User Action Args
2022-04-11 14:58:16adminsetgithub: 68388
2015-05-15 16:55:49yselivanovsetstatus: open -> closed
resolution: fixed
stage: resolved
2015-05-15 16:55:26python-devsetmessages: + msg243282
2015-05-15 16:54:03python-devsetnosy: + python-dev
messages: + msg243280
2015-05-15 16:43:27yselivanovsetmessages: + msg243279
2015-05-15 06:24:48serhiy.storchakacreate