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.

Author steven.daprano
Recipients lgj1993, methane, steven.daprano
Date 2019-03-01.13:30:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20190301110611.GI4465@ando.pearwood.info>
In-reply-to <1551434507.65.0.524954785734.issue36156@roundup.psfhosted.org>
Content
bugs.python.org seems to be down at the moment, so please forgive me if 
this ticket has already been closed and I'm repeating what has already 
been said.

> This is guaranteed to be unique among simultaneously existing objects.

Note the *simultaneously existing* comment. Since the method objects a.a 
and a.a1 don't exist simultaneously, the interpreter is allowed to reuse 
the same ID for each.

(P.S. please, next time use less confusing names!)

Your code does this:

- fetch a.a, which returns a new method object;
- print the ID of that method object;
- throw away and garbage collect the method object;
- fetch a.a1, which returns a new method object;
- print the ID of that method object which happens
  to get the same value as the previous object;
- throw away and garbage collect the method object.

You can see the difference if you do this:

spam = a.a
eggs = a.a1
print(id(spam), id(eggs))

and you will get two different IDs.
History
Date User Action Args
2019-03-01 13:30:00steven.dapranosetrecipients: + steven.daprano, methane, lgj1993
2019-03-01 13:30:00steven.dapranolinkissue36156 messages
2019-03-01 13:30:00steven.dapranocreate