]> 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:48:08 +0000 (08:48 -0800)
committerGitHub <noreply@github.com>
Thu, 27 Jan 2022 16:48:08 +0000 (08:48 -0800)
commitbfcb41420a326ec353740d8180ffbf402746fa33
tree65480798a17cb5096033912cf178e19aa1199f90
parent486a4b382943ed4c965a0a36b177e8e0b083a6e5
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]