Skip to content

Commit ec3d781

Browse files
committed
Forbid ClassVar and Final within TypedDict body
1 parent 438dc29 commit ec3d781

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/spec/typeddict.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,13 @@ make type declarations self-contained, and to simplify the
508508
implementation of type checkers.
509509

510510

511+
ClassVar and Final items
512+
^^^^^^^^^^^^^^^^^^^^^^^^
513+
514+
``ClassVar`` and ``Final`` are not allowed as qualifiers for an item
515+
of a ``TypedDict``. Such an item also causes a hard error at runtime.
516+
517+
511518
Backwards Compatibility
512519
^^^^^^^^^^^^^^^^^^^^^^^
513520

0 commit comments

Comments
 (0)