]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46539: Pass status of special typeforms to forward references (GH-30926)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 27 Jan 2022 16:47:35 +0000 (08:47 -0800)
committerGitHub <noreply@github.com>
Thu, 27 Jan 2022 16:47:35 +0000 (08:47 -0800)
commit37577033baadf5f4a30d0998bae7d26f11a694e2
treea30a4ec4482cbd1ad8c8724287d925e730dc05f7
parent8e98ccc4c3fd1a12f168466422d206d814eba0f9
bpo-46539: Pass status of special typeforms to forward references (GH-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 ced50051bb752a7c1e616f4b0c001f37f0354f32)

Co-authored-by: Gregory Beauregard <greg@greg.red>
Lib/test/test_typing.py
Lib/typing.py
Misc/NEWS.d/next/Library/2022-01-26-20-36-30.bpo-46539.23iW1d.rst [new file with mode: 0644]