DearPyGui
DearPyGui copied to clipboard
Typing support
Is your feature request related to a problem? Please describe. I think it would be great if DearPyGui supported typing.
Describe the solution you'd like
core.pyi stub file is already generated automatically by mvPythonParser, so adding py.typed as part of the source is enough for the type checkers to treat the library as typed.
While looking at the current core.pyi stub file, I noticed two issues:
- currently, the constants are not typed in the stub file
- this means that using names like
mvKey_Downwould still fail once thepy.typedfile is added until the constants get included in the stub file
- this means that using names like
- arguments that accept sequences are typed so that they specifically require a list not just any sequence (for example a tuple), even though they do seem to support that just fine
Describe alternatives you've considered None.
Additional context N/A
Will we look into this. Sounds like a good addition.
It seems that simply adding py.typed to the library root directory allows using mypy (and probably other static type checkers). @hoffstadt any chance this can be done or is there anything slightly more complicated to be done?
Kind of related, I'm also wondering why the dearpygui/_dearpygui.pyi stub file has a circular dependency. This can make tools like the Jedi autocomplete to fail with a RecursionError.