Skip to content

Commit

Permalink
Per review
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Dec 1, 2024
1 parent ec3d781 commit e9d2aee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions docs/spec/class-compat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ annotated in ``__init__`` or other methods, rather than in the class::
def __init__(self, content):
self.content: T = content

``ClassVar`` cannot be used as a qualifier for a :ref:`TypedDict <typeddict>`
item or a :ref:`NamedTuple <namedtuple>`field. Such usages are also hard
errors at runtime.

.. _`override`:

``@override``
Expand Down
4 changes: 4 additions & 0 deletions docs/spec/qualifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ following should be allowed::
Y: Final = "y"
N = NamedTuple("N", [(X, int), (Y, int)])

``Final`` cannot be used as a qualifier for a :ref:`TypedDict <typeddict>`
item or a :ref:`NamedTuple <namedtuple>`field. Such usages are also hard
errors at runtime.

.. _`annotated`:

``Annotated``
Expand Down
7 changes: 0 additions & 7 deletions docs/spec/typeddict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,6 @@ 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 e9d2aee

Please sign in to comment.