Before Python 3.10, you need to use typing.Union to declare that a variable can have one of several different types.
In Python 3.10, you can replace Union[X, Y] with X | Y to simplify the expression.
Before Python 3.10, you need to use typing.Union to declare that a variable can have one of several different types.
In Python 3.10, you can replace Union[X, Y] with X | Y to simplify the expression.