The task is as follows:
there is a class that has 4 properties, 2 of which are read-only
you need to create a second class (in some way dict-like), consisting of a sequence of instances of the first class and in which the composite key of the above two readonly properties should be used. How to make it better?
Hope explained more or less clear
I tried to do it by implementing the __eq__ and __hash__ methods for the first class, and in the second one I kept instances of the first class in the set. Something like this: gist . But I don’t really like it: the creation of a set, of course, happens by the "composite key", but you cannot get a value by this key
Looked at the collections library, but also did not find the right one.