Skip to content

Commit

Permalink
Forbid ClassVar and Final within TypedDict body
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Dec 1, 2024
1 parent 438dc29 commit ec3d781
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/spec/typeddict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit ec3d781

Please sign in to comment.