@@ -290,10 +290,13 @@ the same rules that apply to ``extra_items=Never`` also apply to
290
290
This will be further discussed in
291
291
:ref: `a later section <pep728-inheritance-read-only >`.
292
292
293
- When neither ``extra_items `` nor ``closed=True `` is specified, the TypedDict
294
- is assumed to allow non-required extra items of value type ``ReadOnly[object] ``
295
- during inheritance or assignability checks. This preserves the existing behavior
296
- of TypedDict.
293
+ When neither ``extra_items `` nor ``closed=True `` is specified, ``closed=False ``
294
+ is assumed. The TypedDict should allow non-required extra items of value type
295
+ ``ReadOnly[object] `` during inheritance or assignability checks, to
296
+ preserve the default TypedDict behavior. Extra keys included in TypedDict
297
+ object construction should still be caught, as mentioned in TypedDict's
298
+ `typing spec
299
+ <https://typing.python.org/en/latest/spec/typeddict.html#supported-and-unsupported-operations.> `__.
297
300
298
301
``closed `` is also supported with the functional syntax::
299
302
@@ -600,8 +603,7 @@ be rejected even when ``extra_items`` is specified.
600
603
601
604
Operations that already apply to ``NotRequired `` items should generally also
602
605
apply to extra items, following the same rationale from the `typing spec
603
- <https://typing.python.org/en/latest/spec/typeddict.html#supported-and-unsupported-operations> `__
604
- :
606
+ <https://typing.python.org/en/latest/spec/typeddict.html#supported-and-unsupported-operations> `__:
605
607
606
608
The exact type checking rules are up to each type checker to decide. In some
607
609
cases potentially unsafe operations may be accepted if the alternative is to
@@ -882,8 +884,8 @@ This is supported in `pyright 1.1.386
882
884
revision is supported in `pyanalyze
883
885
0.12.0 <https://github.com/quora/pyanalyze/releases/tag/v0.12.0> `_.
884
886
885
- This is also supported in `typing-extensions 4.13.0rc1
886
- <https://pypi.org/project/typing-extensions/4.13.0rc1 /> `_.
887
+ This is also supported in `typing-extensions 4.13.0
888
+ <https://pypi.org/project/typing-extensions/4.13.0 /> `_.
887
889
888
890
Acknowledgments
889
891
===============
0 commit comments