Before 3.10, I was using Union to create union parameter annotations:
from typing import Union
class Vector:
def __mul__(self, other: Union["Vector", float]):
pass
Now, when I use the new union shorthand syntax:
class Vector:
def __mul__(self, other: "Vector" | float):
pass
I get the error:
TypeError: unsupported operand type(s) for |: 'str' and 'type'
Is this not supported?