-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List comprehension in __all__ definition hides module members #289
Comments
The problem is that you are using wildcard imports with a value of If you comment out two dynamic If you want your package to work correctly with static type checkers, you should either avoid using wildcard imports or replace dynamic |
Thanks for the info! |
Closing old issue. If this is still a problem, please reopen with the information requested. thanks |
Here are the forms of all that type checkers have agreed to support: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface |
Environment data
Expected behaviour
Importing a function from a sub-package using
from package import foo
Pylance is able to find the definition.Actual behaviour
Importing a function from a sub-package using
from package import foo
and hovering on the function, Pylance displays(import) foo: Any
.and when right-clicking and "Go to Definition" displays "No definition found for foo"
If the function is imported using
from package.sub_package import foo
it finds itCode Snippet / Additional information
The folder structure is:
Files content for those who don't want to download the zip file
pylance_test.zip
main.py
package init
sub_package init
sub_package_file.py
package_file.py
The text was updated successfully, but these errors were encountered: