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

Mention implicit export on missing attribute access #13917

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

hauntsaninja
Copy link
Collaborator

Also only suggest public API for attribute access suggestions

Fixes #13908

Accomplishes a similar thing to #9084 (the logic from there could be improved too, will send a PR for that next)

Also only suggest public API for attribute access suggestions

Fixes python#13908

Accomplishes a similar thing to python#9084 (the logic from there could be
improved too, will send a PR for that next)
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

urllib3 (https://github.com/urllib3/urllib3)
- docs/conf.py:55: error: Module has no attribute "__version__"  [attr-defined]
+ docs/conf.py:55: error: "Module urllib3" does not explicitly export attribute "__version__"  [attr-defined]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:232:13: error: Module has no attribute "get_default_path_watcher_class"  [attr-defined]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:232:13: error: "Module streamlit.watcher.local_sources_watcher" does not explicitly export attribute "get_default_path_watcher_class"  [attr-defined]
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:238:13: error: Module has no attribute "get_default_path_watcher_class"  [attr-defined]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:238:13: error: "Module streamlit.watcher.local_sources_watcher" does not explicitly export attribute "get_default_path_watcher_class"  [attr-defined]
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:244:13: error: Module has no attribute "get_default_path_watcher_class"  [attr-defined]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:244:13: error: "Module streamlit.watcher.local_sources_watcher" does not explicitly export attribute "get_default_path_watcher_class"  [attr-defined]
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:249:30: error: Module has no attribute "get_default_path_watcher_class"  [attr-defined]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:249:30: error: "Module streamlit.watcher.local_sources_watcher" does not explicitly export attribute "get_default_path_watcher_class"  [attr-defined]
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:253:17: error: Module has no attribute "get_default_path_watcher_class"  [attr-defined]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:253:17: error: "Module streamlit.watcher.local_sources_watcher" does not explicitly export attribute "get_default_path_watcher_class"  [attr-defined]
- lib/tests/streamlit/web/server/server_test.py:291:42: error: Module has no attribute "ConfigOption"  [attr-defined]
+ lib/tests/streamlit/web/server/server_test.py:291:42: error: "Module streamlit.config" does not explicitly export attribute "ConfigOption"  [attr-defined]

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message was very confusing! 👍

@hauntsaninja hauntsaninja merged commit 9bba377 into python:master Oct 19, 2022
@hauntsaninja hauntsaninja deleted the noreexp branch October 19, 2022 21:43
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Oct 19, 2022
Related to python#13917 and python#13908. This handles situations involving
per-module re-exports correctly / is consistent with the error you'd get
with attribute access.
hauntsaninja added a commit that referenced this pull request Oct 20, 2022
Related to #13917 and #13908. This handles situations involving
per-module re-exports correctly / is consistent with the error you'd get
with attribute access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants