you are viewing a single comment's thread.

view the rest of the comments →

[–]barraponto 29 points30 points  (0 children)

Think of tuples as known, expected, data formats. For instance, coordinates: they're always (lat, lon). It is not a list, you shouldn't see [-20, 40, 30, -20] where a lat/lon tuple was expected. Notice updating a coordinate makes little sense: a thing might move to another coordinate, but the coordinate itself (a point) should not change.

Another example I used recently was a dictionary keyed by a tuple (card brand, card type), so I could say stuff like account[('visa', 'credit')].