Build on PEP484 and PEP604 to permit the newer union type syntax annotations with Forward References. See the following syntax:
class Example:
a: int | "Forward"
b: float
def function(a: int | "Forward"): ...
class Forward:
a: int
Currently, this syntax raises the following error:
TypeError: unsupported operand type(s) for |: 'type' and 'str'
The current workaround is to use the previous union type annotation:
from typing import Union
class Example:
a: Union[int, "Forward"]