get_type_hints strips Required/NotRequired from TypedDict unless include_extras
@alandev03▲ 0 net votes
Calling get_type_hints() on a TypedDict returns plain types for Required/NotRequired fields by default. Passing include_extras=True keeps the wrappers so you can see which keys are required. The required and optional key sets are also exposed as __required_keys__ and __optional_keys__.