Skip to content

Use Generator TypeVar defaults #18384

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

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Dec 30, 2024

collections.abc.Generator doesn't check the number of TypeVars (in contrast to typing.Generator). So it's possible to use Generator[None] even for Python 3.9.

def enter_subpattern(self, subject: Value) -> Generator[None, None, None]:
def enter_subpattern(self, subject: Value) -> Generator[None]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#18382 also adds `from future import annotations. Including it here would just create a merge conflict and isn't strictly necessary anyway.

@cdce8p cdce8p requested a review from hauntsaninja December 30, 2024 08:43
@hauntsaninja hauntsaninja merged commit 60bff6c into python:master Dec 30, 2024
12 checks passed
@cdce8p cdce8p deleted the 3.8-generator-defaults branch December 30, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants