[docs] Possible bug in Python documentation

Mark Ballard markjballard at googlemail.com
Sat Mar 5 18:15:14 CET 2011


Hello

I'm having a lot of fun reading your excellent Python documentation.

I have found a discrepancy that may be attributable to my ignorance, but is
possibly an error, in the section of the documentation dealing with Objects,
Values and Types:

http://docs.python.org/reference/datamodel.html#index-820

The documentation says:

"An object’s identity never changes once it has been created"

While using the interpreter to illustrate the points in the documentation,
it appeared to me that an object's identity does change with its value.

This, for example, is copied from my interpreter and appears to show that
the id of the object a does change when I change its value:

>>> a=20

>>> id(a)
137972908

>>> a=22

>>> id(a)
137972884

I hope this is of some help.

Best regards

Mark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20110305/7a428cf4/attachment-0001.html>


More information about the docs mailing list