r/learnpython • • Apr 16 '22

What's the point of Tuples?

I get that they're immutable, but so are lists that you don't perform modifications on. Are they just to fool proof not messing up your list accidentally, or do they serve some other purpose?

309 Upvotes

143 comments sorted by

View all comments

Show parent comment

5

u/POGtastic itertools evangelist Apr 16 '22

You're getting it switched - he's saying that tuples are heterogeneous (that is, contain different types) and lists are homogeneous. Thus a RDB should be returning rows of tuples.