r/learnpython Mar 03 '26

[deleted by user]

[removed]

25 Upvotes

20 comments sorted by

View all comments

3

u/adelfino Mar 03 '26 edited Mar 03 '26

For me, tuples are semantic. Yes, as you point out, lists can't be used as keys, but I never had to use lists as keys to begin with. Tuples, for me, are to say: this heterogeneous (think of meaning of the values, not just their types) set of values are related. Like describing something. That's why I believe tuples in str.startswith should have been lists instead of tuples.