Skip to content
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

Specs clarification: Forbid ClassVar and Final within TypedDict body #1890

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Forbid ClassVar and Final within TypedDict body
InSyncWithFoo committed Dec 1, 2024
commit ec3d7814d53474fe1b0642b4adb79b18af5945e8
7 changes: 7 additions & 0 deletions docs/spec/typeddict.rst
Original file line number Diff line number Diff line change
@@ -508,6 +508,13 @@ make type declarations self-contained, and to simplify the
implementation of type checkers.


ClassVar and Final items
^^^^^^^^^^^^^^^^^^^^^^^^

``ClassVar`` and ``Final`` are not allowed as qualifiers for an item
of a ``TypedDict``. Such an item also causes a hard error at runtime.


Backwards Compatibility
^^^^^^^^^^^^^^^^^^^^^^^