Skip to content
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

Use of "from .x import y" in pyi file should add implicit symbol export of "x" #782

Closed
erictraut opened this issue Jul 1, 2020 · 2 comments
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@erictraut
Copy link
Collaborator

According to PEP 484:

Just like in normal Python files [importdocs], submodules automatically become exported attributes of their parent module when imported. For example, if the spam package has the following directory structure:

spam/
init.pyi
ham.pyi
where init.pyi contains a line such as from . import ham or from .ham import Ham, then ham is an exported attribute of spam.

@erictraut erictraut added the bug Something isn't working label Jul 1, 2020
@erictraut erictraut changed the title Use of "from . import x" or "from .x import y" in pyi file should add implicit symbol export Use of "from .x import y" in pyi file should add implicit symbol export of "x" Jul 1, 2020
@erictraut
Copy link
Collaborator Author

@federicobond, this is now addressed, and the fix will be in the next version of Pyright and Pylance. Thanks again for reporting the problem.

@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Jul 2, 2020
@erictraut
Copy link
Collaborator Author

This is addressed in Pyright 1.1.49, which I just published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant