Surely what you're looking for is some kind of typed hash table? Maybe you
should be suggesting adding a TypedMapping to collections or something like
that? But it seems to be your solution is fine, but maybe could abstract away
the types in the keys in the class dunders?
```
class TypedMapping(dict):
def __getitem__(self, item):
return super().__getitem__((item, type(item)))
...
```
And so on
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/VAPFARSZB6TRIQQAWANXMNAKQAM3GVDS/
Code of Conduct: http://python.org/psf/codeofconduct/