[issue11846] Implementation question for (-5) - 256 caching, and doc update for c-api/int.html
Antoine Pitrou
report at bugs.python.org
Thu Apr 14 23:22:02 CEST 2011
Antoine Pitrou <pitrou at free.fr> added the comment:
I don't think it's in the business of the C API docs to explain Python-visible semantics, or the difference between "==" and "is". I would just rephrase the original paragraph, removing the last sentence joke:
“Since integer objects are very frequently created, certain optimizations can be applied on their allocation. For example, the current implementation keeps an array of integer objects for all integers between -5 and 256: when you create an int in that range, you actually just get back a reference to the existing object.”
----------
nosy: +pitrou
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11846>
_______________________________________
More information about the Python-bugs-list
mailing list