+ 1
Why can custom types be keys?
Objects for dict keys are supposed to be immutable and can not contain mutable elements. Yet you can define a class and take the class itself as a key, although you could add or delete attributes at runtime. What's the logic behind this?
1 ответ
+ 5
https://wiki.python.org/moin/DictionaryKeys