Size of tuples

Ignacio Vazquez-Abrams ignacio at
Wed Sep 5 21:20:10 CEST 2001

On 5 Sep 2001, Peter van der Kamp wrote:

> Hello,
> Does anyone anyone know what the maximum size of
> a tuple can be? Examples in documentation only contains
> a small amount of data, but I like to know if they can contain
> e.g. >100000 integers. Furthermore I would like to know
> the consequences for performance. Does the 'x in tuple'
> statement perform much worse with the amounts of data
> I have in mind?
> Thanks.
> Peter van der Kamp

After digging through the Python 2.1.1 source, it appears that getting by
index is O(1) and finding containment (i.e., 'x in tuple') is O(n).

Ignacio Vazquez-Abrams  <ignacio at>

More information about the Python-list mailing list