A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/040752.html below:

[Python-Dev] Int FutureWarnings and other 2.4 TODOs

[Python-Dev] Int FutureWarnings and other 2.4 TODOs [Python-Dev] Int FutureWarnings and other 2.4 TODOsThomas Heller theller at python.net
Fri Dec 5 10:37:10 EST 2003
Guido van Rossum <guido at python.org> writes:

>> IIUC, doing range(10000000) in a program somewhere allocates 10 million
>> integers, and these are *never* freed, they live in the cache forever.
>> Correct?
>
> Wrong.  The memory allocated can never be used for other objects than
> ints, but it will be reused for other ints.  IOW if you do
>
>   for i in range(100):
>       range(i*1000000, (i+1)*1000000)
>
> you only allocate space for 1000000 ints, not for 100 times 1000000
> ints.  (The range(100) OTOH are all in a cache that make the objects
> indestructible, but this only applies to values in [-5, 100).

Ok, then it makes sense.  Thanks for the clarification.

Thomas


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4