On Mon, Dec 21, 2020 at 9:25 AM Christopher Barker <pythonchb@gmail.com> wrote:
[Mathew Elman wrote:]
Surely what you're looking for is some kind of typed hash table?

Maybe, maybe not. My impression is that the Typed hash  table is a kluge to get around this one issue.

For what it's worth, functools.lru_cache has a "typed" option that effectively adds the type()s of the arguments to the cache key. It was added by https://bugs.python.org/issue13227 . The only application of it in that patch was to re's compiled pattern cache, which needs to be typed to avoid spurious warnings or errors with -b or -bb, I suppose.