pylance-release
pylance-release copied to clipboard
Don't suggest imports from private modules
Let's say we have the following directory contents:
foo/
__init__.py
_bar.py
The contents look like so:
# __init__.py
from ._bar import baz
__all__ = ["baz"]
If I try to import auto-import baz, pyright seems to use from foo._bar import baz
and I have to manually change the import. Could we prevent pyright and pylance from suggesting imports from private modules?
For context, I'm using coc-pyright with vim8, so it's totally possible I'm missing something, but I've looked for a while and can't find a good solution to this.
Also, I originally created this question on https://github.com/microsoft/pyright/discussions/8612#discussion-6996652.