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