I am looking for a data structure in Python that is similar to a dictionary. The difference is that there is two keys. I want to be able to access the value in constant time.
Like:
dict.get(dog, smurf)
{(dog, smurf): 40}
Is this possible?
If this doesn’t exist, I would just do a dictionary in a dictionary. But, the above would be more convenient.
{dog: {(smurf: 40)}}
What’s stopping you?