-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide imported names in stubs unless 'as id' is used (PEP 484) (#3706)
Fixes #2927 PEP 484 specifies that only names imported as ``from mod import name as name`` should be re-exported. However, mypy didn't follow this rule so that this code passed without errors but obviously fails at runtime: from collections import TypeVar from weakref import Generic from getopt import List T = TypeVar('T') class C(Generic[T], List[int]): ... This PR makes all these errors.
- Loading branch information
1 parent
6366a02
commit c87e413
Showing
3 changed files
with
148 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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