diff --git a/peps/pep-0728.rst b/peps/pep-0728.rst index 6b370d5018e..6785e937e62 100644 --- a/peps/pep-0728.rst +++ b/peps/pep-0728.rst @@ -215,7 +215,7 @@ the ``extra_items`` argument:: ``extra_items`` is inherited through subclassing:: - class MovieBase(TypedDict, extra_items=int | None): + class MovieBase(TypedDict, extra_items=ReadOnly[int | None]): name: str class Movie(MovieBase): @@ -380,6 +380,7 @@ unless it is declared to be ``ReadOnly`` in the superclass:: pass class Child(Parent, extra_items=int): # Not OK. Like any other TypedDict item, extra_items's type cannot be changed + pass Second, ``extra_items=T`` effectively defines the value type of any unnamed items accepted to the TypedDict and marks them as non-required. Thus, the above