Preserve (some) implicitly exported types#13967
Merged
JukkaL merged 1 commit intopython:masterfrom Oct 31, 2022
Merged
Conversation
Fixes some of python#13965 We also need to modify attribute access logic (this is the TODO in the PR), which is a little trickier. But cases like python#13933 convinced me it's worth making this change, even before I get around to figuring that out.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: urllib3 (https://github.com/urllib3/urllib3)
+ test/test_connection.py:60: error: "CertificateError" has no attribute "_peer_cert" [attr-defined]
+ test/test_connection.py:75: error: "CertificateError" has no attribute "_peer_cert" [attr-defined]
+ test/test_connection.py:135: error: "CertificateError" has no attribute "_peer_cert" [attr-defined]
+ test/test_connection.py:169: error: "CertificateError" has no attribute "_peer_cert" [attr-defined]
streamlit (https://github.com/streamlit/streamlit)
+ lib/tests/streamlit/web/server/browser_websocket_handler_test.py: note: In member "test_backmsg_deserialization_exception" of class "BrowserWebSocketHandlerTest":
+ lib/tests/streamlit/web/server/browser_websocket_handler_test.py:75:58: error: Incompatible types in assignment (expression has type "SessionClient", variable has type "BrowserWebSocketHandler") [assignment]
parso (https://github.com/davidhalter/parso)
- parso/python/tree.py:49: error: Name "Mapping" already defined (possibly by an import) [no-redef]
|
Collaborator
Author
|
mypy_primer looking good! |
JukkaL
approved these changes
Oct 31, 2022
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Nice, the new behavior seems clearly better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes some of #13965, fixes #12749
We also need to modify attribute access logic (this is the TODO in the PR), which is a little trickier. But cases like #13933 convinced me it's worth making this change, even before I get around to figuring that out.