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 terry.reedy
Recipients docs@python, terry.reedy
Date 2011-10-17.17:50:34
SpamBayes Score 2.5457636e-11
Marked as misclassified No
Message-id <1318873835.36.0.466865504792.issue13203@psf.upfronthosting.co.za>
In-reply-to
Content
Newbies too often do something like (3.2.2, )

>>> id(getattr(x, 'pop')) == id(x.pop)
True

and get confused by the (invalid) result, whereas

>>> a,b=getattr(x, 'pop'),x.pop
>>> id(a)==id(b)
False

works properly. I think we should add a sentence or two or three to the id() doc, such as

Since a newly created argument object is either destroyed or becomes inaccessible before the function returns, *id(obj)* is only useful and valid if *obj* exists prior to the call and therefore after its return.
The value of an expression such as *id(666)== id(667)* is arbitrary and meaningless. The id of the first int object might or might not be reused for the second one.
History
Date User Action Args
2011-10-17 17:50:35terry.reedysetrecipients: + terry.reedy, docs@python
2011-10-17 17:50:35terry.reedysetmessageid: <1318873835.36.0.466865504792.issue13203@psf.upfronthosting.co.za>
2011-10-17 17:50:34terry.reedylinkissue13203 messages
2011-10-17 17:50:34terry.reedycreate