We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5e2ca9 commit e7e5af4Copy full SHA for e7e5af4
peps/pep-0728.rst
@@ -215,7 +215,7 @@ the ``extra_items`` argument::
215
216
``extra_items`` is inherited through subclassing::
217
218
- class MovieBase(TypedDict, extra_items=int | None):
+ class MovieBase(TypedDict, extra_items=ReadOnly[int | None]):
219
name: str
220
221
class Movie(MovieBase):
@@ -380,6 +380,7 @@ unless it is declared to be ``ReadOnly`` in the superclass::
380
pass
381
382
class Child(Parent, extra_items=int): # Not OK. Like any other TypedDict item, extra_items's type cannot be changed
383
+ pass
384
385
Second, ``extra_items=T`` effectively defines the value type of any unnamed
386
items accepted to the TypedDict and marks them as non-required. Thus, the above
0 commit comments