Contents

Related

Python typing

Unions

For Python 3.10 onwards1, Unions can be specified with the character |. For instance:

Union[int, str, float] # before 3.10
int | str | float      # after 3.10