python-language-server
python-language-server copied to clipboard
Prefer explicit exports when generating imports
For example, flask's __init__.py explicitly exports many common symbols. But when generating an import e.g. for url_for, it will import it from flask.helpers instead.
My suggestion would be to take symbols listed in __all__ into account and, in case this is not defined, take the shortest possible import based on which __init__.py imports a symbol (which in case of the example above would be from flask import url_for)