typed_dict
1from typing import Optional 2from typing import TypedDict 3 4 5class Foo(TypedDict): 6 a: Optional[int] 7 """First attribute.""" 8 9 10class Bar(Foo, total=False): 11 """A TypedDict subclass. Before 3.12, TypedDict botches __mro__.""" 12 13 b: int 14 """Second attribute.""" 15 c: str 16 # undocumented attribute 17 18 19class Baz(Bar): 20 """A TypedDict subsubclass.""" 21 22 d: bool 23 """new attribute"""
class
Foo(typing.TypedDict):
11class Bar(Foo, total=False): 12 """A TypedDict subclass. Before 3.12, TypedDict botches __mro__.""" 13 14 b: int 15 """Second attribute.""" 16 c: str 17 # undocumented attribute
A TypedDict subclass. Before 3.12, TypedDict botches __mro__.
A TypedDict subsubclass.