First time here? Check out the FAQ!

Revision history  [back]

Autocompletion on classes with __getattr__

Hi! I would like to improve the autocompletion support for one of my libraries with type annotations.

The library is a database wrapper. For each table there is a dataset class in Python and the dataset instances allow to access the column values via __getattr__.

For autocompletion in the debugger, Wing is calling __dir__() and __getattr__(), but that does obviously work only for instances.

When I add a type annotation to a method, it seems that Wing does only autocomplete the attribute and method names that are available from static source code analysis. Is there a way to tell Wing which dynamic attributes a class will have and maybe even their data types?