Python typing
Unions
For Python 3.10 onwards1, Union
s can be specified with the character |
. For instance:
int, str, float] # before 3.10
Union[int | str | float # after 3.10
Footnotes
https://docs.python.org/3/library/typing.html#typing.Union↩︎