Bump typing_extensions dependency#15488
Merged
hauntsaninja merged 3 commits intopython:masterfrom Jun 21, 2023
Merged
Conversation
AlexWaygood
reviewed
Jun 21, 2023
Member
|
I checked for other imports using this script: import ast
import itertools
import pathlib
names = set[str]()
class ImportFinder(ast.NodeVisitor):
def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
self.generic_visit(node)
if node.module != "typing_extensions":
return
names.update({obj.name for obj in node.names})
def visit_Attribute(self, node: ast.Attribute) -> None:
self.generic_visit(node)
match node:
case ast.Attribute(ast.Name("typing_extensions"), attr):
names.add(attr)
case _:
pass
for path in itertools.chain(
pathlib.Path("mypy").rglob("*.py"),
pathlib.Path("mypyc").rglob("*.py")
):
ImportFinder().visit(ast.parse(path.read_text()))
print(names)The |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood
reviewed
Jun 21, 2023
| @@ -222,7 +222,7 @@ def run(self): | |||
| # When changing this, also update mypy-requirements.txt. | |||
Member
There was a problem hiding this comment.
We should probably also update mypy-requirements.txt
Contributor
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
hauntsaninja
pushed a commit
that referenced
this pull request
Jun 24, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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.
Mypy started using
typing_extensions.Selfwhich is only available in>=4.0.0.https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-401-november-30-2021
Fixes: #15487