You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In typeddicts_required.py the conformance suite requires an error for Required[Required[int]], but in the spec (typeddict.rst) we say:
This annotation expression contains a :term:type expression, optionally qualified with one of the :term:type qualifiers <type qualifier>Required, NotRequired, or ReadOnly. These type qualifiers may be nested arbitrarily or wrapped in Annotated[]. It is an error to use both Required and NotRequired in the same item definition.
That means that nesting Required/NotRequired in itself is allowed. (I wrote that sentence. I was probably intending to allow nesting Required in ReadOnly and vice versa.)
Repeating the same qualifier is obviously useless and all type checkers already disallow it, so I'd propose to change the spec to explicitly disallow it.
Activity
typeddict: disallow nesting Required in itself (python#2374)