3 ms·
Small nitpick -- Python doesn't require immutable objects for dictionary keys, it just won't work correctly in some cases with mutable keys.
by jmillikin 17y ago
Small nitpick -- Python doesn't require immutable objects for dictionary keys, it just won't work correctly in some cases with mutable keys.
- ubernostrum 17y agoWell, technically the requirement is to implement both __hash__() and one of __eq__()/__cmp__(). But Python fudges this a bit in how it handles user-defined types.