Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 476 Bytes

python3.9-type-hinting.md

File metadata and controls

17 lines (14 loc) · 476 Bytes

Python 3.9 type hinting

For python >= 3.9, you can use PEP585 style type annotations for standard collections.

@serde
@dataclass
class Foo:
    i: int
    l: list[str]
    t: tuple[int, float, str, bool]
    d: dict[str, list[tuple[str, int]]]
    o: Optional[str]
    nested: Bar

For complete example, please see examples/collection.py