3 ms·
I’m guessing they’re implying tuple, it’s pretty common to consider that type as “immutable list” (although personally I very much dislike this categorisation)
by uranusjr 4y ago
I’m guessing they’re implying tuple, it’s pretty common to consider that type as “immutable list” (although personally I very much dislike this categorisation)
- masklinn 4y ago> although personally I very much dislike this categorisation It’s not a categorisation, it’s literally the nature of the thing in Python. And while I agree that it’s distasteful the error was in the original introduction. As things are, python tuples are immutable sequences with all that implies. They are iterable, indexable, sliceable, …
- baq 4y agoImmutability crucially allows for hashability, so you can use (some) tuples as dict keys.