You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
The idea is to import all submodules for a module inside the __init__.py file for cleaner access to classes and functions. The module would behave like a big file with all its subclasses.
The proposal @feeds wrote loads all the submodules dynamically on startup. However some (probably all) IDEs fail to detect the dynamically loaded modules resulting in the linter to giving false errors of non-existing modules.
Let's test this with more people of our team whether this works with IDE linting or whether we need special configuration for this to work, which should then maybe be included in the repository.
Create a python stub (similar to header files in c)
Apply the "static" hack (manually specifying the imports in an unreachable statement)
The python stub can probably be automatically generated with a pre-commit hook? Not sure if methods can be found if they are missing in the python stub.
Both methods would involve manually adding the files needed to be imported. Leaving it out would only result in the IDE to cry, the code would still work (because of the automatic dynamic import on startup)
The idea is to import all submodules for a module inside the
__init__.py
file for cleaner access to classes and functions. The module would behave like a big file with all its subclasses.The proposal @feeds wrote loads all the submodules dynamically on startup. However some (probably all) IDEs fail to detect the dynamically loaded modules resulting in the linter to giving false errors of non-existing modules.
Let's test this with more people of our team whether this works with IDE linting or whether we need special configuration for this to work, which should then maybe be included in the repository.
Originally posted by @bjrne in #509
The text was updated successfully, but these errors were encountered: