A collection of cheat sheets.
Hosted on GitHub Pages — Theme by mattgraham
Any
str
int
float
Sequence[T]
MutableSequence[T]
List[T]
Tuple[T1, T2, ...]
AbstractSet[T]
MutableSet[T]
Mapping[K, V]
MutableMapping[K, V]
Callable[[P1, P2, ...], R]
from typing import NewType
Age = NewType('Age', int)
from typing import TypeVar, Generic
T = TypeVar('T')
class SomeClass(Generic[T]):
...