-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-46539: Pass status of special typeforms to forward references #30926
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
Conversation
Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This is not a full review.)
Misc/NEWS.d/next/Library/2022-01-26-20-36-30.bpo-46539.23iW1d.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, looks good. Taking into account the recent discussions of backports for typing.py, should this be backported?
I think it should be, this one is even more clearly a bugfix (and frankly, not that likely to appear in practice). |
Thanks @GBeauregard for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @GBeauregard for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…thonGH-30926) Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses. (cherry picked from commit ced5005) Co-authored-by: Gregory Beauregard <greg@greg.red>
GH-30946 is a backport of this pull request to the 3.9 branch. |
…thonGH-30926) Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses. (cherry picked from commit ced5005) Co-authored-by: Gregory Beauregard <greg@greg.red>
GH-30947 is a backport of this pull request to the 3.10 branch. |
…-30926) Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses. (cherry picked from commit ced5005) Co-authored-by: Gregory Beauregard <greg@greg.red>
…-30926) Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses. (cherry picked from commit ced5005) Co-authored-by: Gregory Beauregard <greg@greg.red>
…thonGH-30926) Previously this didn't matter because there weren't any valid code paths that could trigger a type check with a special form, but after the bug fix for `Annotated` wrapping special forms it's now possible to annotate something like `Annotated['ClassVar[int]', (3, 4)]`. This change would also be needed for proposed future changes, such as allowing `ClassVar` and `Final` to nest each other in dataclasses. (cherry picked from commit ced5005) Co-authored-by: Gregory Beauregard <greg@greg.red>
Previously this didn't matter because there weren't any valid code paths
that could trigger a type conversion with a special form, but after the bug
fix for
Annotated
wrapping special forms it's now possible to annotatesomething like
Annotated['ClassVar[int]', (3, 4)]
. This change wouldalso be needed for proposed future changes, such as allowing
ClassVar
and
Final
to nest each other in dataclasses.https://bugs.python.org/issue46539