FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-46539: Pass status of special typeforms to forward references by GBeauregard · Pull Request #30926 · python/cpython · GitHub

Repository navigation

bpo-46539: Pass status of special typeforms to forward references - #30926

Merged
gvanrossum merged 6 commits into
python:mainfrom
GBeauregard:fix-special-forms
Jan 27, 2022
Merged

gvanrossum merged 6 commits into
python:mainfrom
GBeauregard:fix-special-forms

Conversation

GBeauregard commented Jan 26, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

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 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.

https://bugs.python.org/issue46539

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.
JelleZijlstra self-requested a review January 26, 2022 20:41

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(This is not a full review.)

Comment thread Lib/typing.py Outdated
GBeauregard changed the title bpo-46539: Pass status of special forms to forward references bpo-46539: Pass status of special typeforms to forward references Jan 26, 2022
Comment thread Lib/typing.py Outdated
Comment thread Lib/test/test_typing.py
GBeauregard marked this pull request as ready for review January 27, 2022 01:58

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Okay, looks good. Taking into account the recent discussions of backports for typing.py, should this be backported?

gvanrossum merged commit ced5005 into python:main Jan 27, 2022

Copy link
Copy Markdown
Member

I think it should be, this one is even more clearly a bugfix (and frankly, not that likely to appear in practice).

Copy link
Copy Markdown
Contributor

Thanks @GBeauregard for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

Copy link
Copy Markdown
Contributor

Thanks @GBeauregard for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 27, 2022
…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>

Copy link
Copy Markdown

GH-30946 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 27, 2022
…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>

Copy link
Copy Markdown

GH-30947 is a backport of this pull request to the 3.10 branch.

miss-islington added a commit that referenced this pull request Jan 27, 2022
…-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>
miss-islington added a commit that referenced this pull request Jan 27, 2022
…-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>
GBeauregard deleted the fix-special-forms branch February 6, 2022 09:03
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…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>
Daraan added a commit to Daraan/typing_extensions that referenced this pull request Mar 26, 2025
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL