Slide 19
Slide 19 text
For Generics, until 3.9, you had to write from typing import ...
Such as Dict , List and Tuple etc...
From 3.9, it's deprecated.
from typing import Dict, List, Tuple, ... # before 3.9
def some_function() -> Tuple[List[int], Dict[str, bool]]: pass
Since 3.9, no more need these import statement!
def some_function() -> tuple[list[int], dict[str, bool]]: pass
(Deprecated since 3.9) import from typing
module
19 / 49