maximum length of a list & tuple

Ed Suominen ed-no at spam-eepatents.com
Thu Apr 8 20:37:04 EDT 2004


I think the limit is 1000 recursion levels, but you shouldn't need to ever
get anywhere near that. Use generators to break up the iteration of your
list comparisons.

-Ed Suominen

Lupe wrote:

> hi,
> 
> I'm finishing a small program which uses recursion for less than 100
> levels.
> 
> Each time the function is called, it compares an element of a list (which
> is a list too) to other elements, which all amounts to millions of
> comparisons.
> 
> The program is working for short lists but not for longer ones.  I think
> there are two possible problems:  either disk space is not enough to save
> lists as the program is executed or there is a finite manageable list
> lenght that is reached by the program.
> 
> hence my question:
> 
> is there a limit? which one? I'm using list.append()
> what about for tuples?
> 
> I'll rewrite that part of the code and will overcome the problem, since I
> only need a few elements of the list generated, but I'm still curious
> about the answers
> 
> Thanks in advanve
> 
> Lupe




More information about the Python-list mailing list