[issue36156] different method, but id function return same value.

Inada Naoki report at bugs.python.org
Fri Mar 1 05:24:01 EST 2019


Inada Naoki <songofacandy at gmail.com> added the comment:

a.a creates temporal method object.  After id(a.a), it is removed.
So a.a and a.a1 are not "simultaneously existing objects" in your case.

Try this:

x = a.a
y = a.a1
id(x), id(y)

x and y are "simultaneously existing objects" now.

----------
nosy: +inada.naoki
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36156>
_______________________________________


More information about the Python-bugs-list mailing list