Help understanding the decisions *behind* python?

sturlamolden sturlamolden at yahoo.no
Sun Aug 2 03:31:15 CEST 2009


On 20 Jul, 18:27, Phillip B Oldham <phillip.old... at gmail.com> wrote:

> We're not looking to start any arguments or religious wars and we're
> not asking that python be changed into something its not. We'd simply
> like to understand the decision behind the lists and tuple structures.
> We feel that in not "getting" the difference between the two types we
> may be missing out on using these data structures to their full
> potential.

A crude simplification would be:

- A Python programmer will use a tuple where a C programmer will use a
struct.

- Python and C programmers use lists and arrays similarly.

Tuples are used for passing arguments to and from a function. Common
use of tuples include multiple return values and optional arguments
(*args).

It has already been mentioned that tuples are immutable and can be
used as dictionary keys.









More information about the Python-list mailing list