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 rhettinger
Recipients antlong, dmalcolm, pitrou, rhettinger
Date 2011-04-14.21:39:24
SpamBayes Score 6.17121e-08
Marked as misclassified No
Message-id <>
We should remove the documentation entries that discuss non-guaranteed implementation details (i.e. which integers are singletons).

Instead, there should probably be a brief tutorial entry on what aspects of object identity people can rely on:

* None, True, and False are singletons.  PEP 8 recommends testing for None with "is".

* Most internal equality comparisons (i.e. that in list.count or list.__contains__) assume that identity-implied-equality regardless of how __eq__ is defined (i.e. an object is always equal to itself).

* Once created, an object doesn't change its identity.  So, you can use "is" to find the exact same object at a later stage in a program.

* Unless documented otherwise (a singleton class telling you that it returns the same object every time), no other assumptions should be made about object identity.  In particular, one cannot assume that an object id won't be re-used after the object is reclaimed.
Date User Action Args
2011-04-14 21:39:25rhettingersetrecipients: + rhettinger, pitrou, dmalcolm, antlong
2011-04-14 21:39:25rhettingersetmessageid: <>
2011-04-14 21:39:24rhettingerlinkissue11846 messages
2011-04-14 21:39:24rhettingercreate