Hacker News new | ask | show | jobs
by chubot 1038 days ago
Yeah this is what MyPy does internally too

You just have a big dict of types, which are keyed by the AST node

It seemed a bit weird to me, but certainly works. I guess I usually use dicts that are keyed by value and not by address of the instance