TODO: mypy
- Complex data structures?
- My types/classes?
- Allow None (or not) for a variable.
examples/types/generator.py
from typing import Generator def numbers(n: int) -> Generator[int, None, None]: return ( x for x in range(n)) print(list(numbers(10)))
examples/types/list.py
from typing import List def numbers(n: int) -> List[int]: return list(range(n)) print(numbers(10))