Skip to content

Commit e9d2aee

Browse files
committed
Per review
1 parent ec3d781 commit e9d2aee

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

docs/spec/class-compat.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ annotated in ``__init__`` or other methods, rather than in the class::
8989
def __init__(self, content):
9090
self.content: T = content
9191

92+
``ClassVar`` cannot be used as a qualifier for a :ref:`TypedDict <typeddict>`
93+
item or a :ref:`NamedTuple <namedtuple>`field. Such usages are also hard
94+
errors at runtime.
95+
9296
.. _`override`:
9397

9498
``@override``

docs/spec/qualifiers.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ following should be allowed::
203203
Y: Final = "y"
204204
N = NamedTuple("N", [(X, int), (Y, int)])
205205

206+
``Final`` cannot be used as a qualifier for a :ref:`TypedDict <typeddict>`
207+
item or a :ref:`NamedTuple <namedtuple>`field. Such usages are also hard
208+
errors at runtime.
209+
206210
.. _`annotated`:
207211

208212
``Annotated``

docs/spec/typeddict.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,6 @@ 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-
518511
Backwards Compatibility
519512
^^^^^^^^^^^^^^^^^^^^^^^
520513

0 commit comments

Comments
 (0)