Raymond Hettinger wrote:
How many items can be stored in a Python list? I have close to 70,000
items... is this within a lists limits?


Lists store pointers to objects.  Unless you have a lot of duplicates, it is the
objects themselves that will consume most of your memory.  The list itself will
likely be small in comparison.

Given the size of the counter, is it actually physically possible for a list to run out of room before the application runs out memory?


Even list(None for x in xrange(sys.maxint)) wouldn't do the trick, since each of those pointers to None is taking 4 bytes of memory, and Python's internal structures are already chewing up some of the address space.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to