Closed BrutalSimplicity closed 2 years ago
I have not tested it with VS Code or other IDE’s than PyCharm so I cannot tell.
However, many interpreters, e.g. ipython or pycharm debugger, utilize the __dir__
method of in-memory objects to dynamically show their attributes and methods via autocomplete (hit tab key). This works only in an interactive environment, e.g. a debugger. The MetaDict()
object must be in memory, otherwise it cannot work.
So statically, in the editor there cannot be any autocompletion, since the IDE cannot look up the attributes from a typed Class.
Does this solution happen to also work with VSCode? At first attempt, it doesn't seem that pyright is able to resolve this, but maybe I'm missing a configuration setting.
Thanks. This is beautiful work!