PyDocs

Nav

Development Tools

NotRequired

typing

data · Added in 3.11
Special typing construct to mark a TypedDict key as potentially missing.

For example::

    class Movie(TypedDict):
        title: str
        year: NotRequired[int]

    m = Movie(
        title='The Matrix',  # type checker error if key is omitted
        year=1999,
    )
0 Examples
No examples for typing/NotRequired.
See Also
No see-alsos for typing/NotRequired
0 Notes
No notes for NotRequired