3 ms·
Yep, that's right. To lay out the example the way you did in the article, it would look like: >>> foo = A.b >>> bar = A.b >>> hex(id(foo)) '0xd
by phasmantistes 10y ago
Yep, that's right. To lay out the example the way you did in the article, it would look like:
>>> foo = A.b
>>> bar = A.b
>>> hex(id(foo))
'0xdeadbeef'
>>> hex(id(bar))
'0xdecafcab'
>>> foo is bar
False