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 dmalcolm
Recipients antlong, dmalcolm
Date 2011-04-14.21:17:04
SpamBayes Score 1.36112e-08
Marked as misclassified No
Message-id <>
From IRC discussion, how about something like:

The current implementation consolidates integers in the range -5 to 256 (inclusive) into singleton PyIntObject instances, whereas other integer values have unique PyIntObject instances created for them.

This means that on CPython::

   >>> -5 is -5


   >>> -6 is not -6

This behavior is an implementation detail of CPython, and is not required by other implementations of Python.

In particular:
  - do not manipulate the internal value of a PyIntObject after creation
  - do not use "is" for comparing integer values, use "==" instead.
Date User Action Args
2011-04-14 21:17:05dmalcolmsetrecipients: + dmalcolm, antlong
2011-04-14 21:17:05dmalcolmsetmessageid: <>
2011-04-14 21:17:05dmalcolmlinkissue11846 messages
2011-04-14 21:17:04dmalcolmcreate