Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Latest commit

 

History

History
18 lines (15 loc) · 493 Bytes

python3.9-type-hinting.md

File metadata and controls

18 lines (15 loc) · 493 Bytes

Python 3.9 type hinting

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

@deserialize
@serialize
@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