-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Intellisense doesn't respect __all__ when using import *
#494
Comments
We won't be changing this because (1) there are legitimate reasons to want to ignore |
I agree that it is generally discouraged but in certain situations it makes sense, for example within a library to expose members of internal modules within a single public facing module. Instead of explicitly importing each name of the internal modules, a star import is quite handy and it also serves for clearly defining what the public API is made out of. |
Squiggle underlines gets into linting which means we rely on Pylint, flake8, or whatever linter you choose to use. So if you want to be warned that you are using something not contained in |
I'm not sure if we're on the same page here. Ignore the squiggle lines for now. The main problem is that intellisense displays a lot more than what is actually possible to invoke. The members just do not exist and there will be a hard error at runtime. This is not about warnings or hiding private functions from novice users, it's about correctly computing the set of reachable symbols. Have a look at the example again to see what I mean. |
OK, now I see where you're coming from with your example. Sorry about the misunderstanding. 😄 I've re-opened this as an issue and I have confirmed this issue does exist. |
import *
And FYI this is probably going to be an issue in Jedi. @MikhailArkhipov this might be something for your meta issue on intellisense. |
I found this: davidhalter/jedi#715 :/ |
Which is closed as 'wont fix' |
Works fine in VS engine. Won't be fixed in Jedi. |
Still an issue in the Microsoft Python Language Server. Python extension: 2018.12.1 (with the early/nightly updates setting set) Is there a more lively issue tracking this? |
I can verify this isn't working in the language server v0.1.78. I've opened microsoft/python-language-server#619 to track this upstream. |
Fixed upstream. |
Environment data
VS Code version: 1.19.1
Python Extension version: 0.9.1
Python Version: 3.6.0
OS and version: Win 10
Actual behavior
Expected behavior
With the code above intellisense should only show
foo
.The text was updated successfully, but these errors were encountered: