typing
Type | Description |
---|---|
dict[T1, T2] |
A dictionary whose keys have type Example: |
list[T] |
A list whose elements all have type Example: |
set[T] |
A set whose elements all have type Example: |
tuple[T1, T2, ...] |
A tuple whose first element has type Example: |
typing
moduleReference: https://docs.python.org/3.10/library/typing.html.
Type | Description |
---|---|
Any |
A value that could be of any type. (Used as a placeholder when a variable’s type could be anything, or is unknown.) |
Callable[[T1, T2, ...], Tr] |
A function whose parameters have type Example: the function
has type |
Optional[T] |
Synonym of Union[T, None] . |
Union[T1, T2, ...] |
A value whose type is one of Example: both |