Tuple slices

Fredrik Lundh fredrik at pythonware.com
Mon Jan 24 12:45:46 EST 2005


George Sakkis wrote:

> Why does slicing a tuple returns a new tuple instead of a view of the existing one, given that
> tuples are immutable ?

really?

>>> a = 1, 2, 3
>>> b = a[:]
>>> a is b
True

</F> 






More information about the Python-list mailing list