lists v. tuples

castironpi at gmail.com castironpi at gmail.com
Mon Mar 17 08:28:19 EDT 2008


On Mar 17, 6:49 am, MartinRineh... at gmail.com wrote:
> What are the considerations in choosing between:
>
>    return [a, b, c]
>
> and
>
>     return (a, b, c) # or return a, b, c
>
> Why is the immutable form the default?

Using a house definition from some weeks ago, a tuple is a data
structure such which cannot contain a refrence to itself.  Can a
single expression refer to itself ever?



More information about the Python-list mailing list