- Union types:
int | float
- Tuple:
tuple[int, str]
- List:
list[int]
- Function types
Callable[[int, str], bool]
: int * str -> boolCallable[[], bool]
: No arg 'function' returning a boolCallable[[int], None]
: 'Function' accepting an int that doesn't return a valueCallable[..., int]
: Function accepting any number of args and returning an int
- Unknown type: ~Any`
Final
- Value of variable shouldn't be allowed to change after this point
- Change allowed before though
- Static type checker only, interpreter doesn't care
This is not the same as typing.final
.