"""Tests Mapped covariance."""\r
\r
from datetime import datetime\r
+from typing import List\r
from typing import Protocol\r
from typing import Sequence\r
from typing import TypeVar\r
\r
# Make sure that relationships are covariant as well\r
_BaseT = TypeVar("_BaseT", bound=Base, covariant=True)\r
-RelationshipType = (\r
- InstrumentedAttribute[_BaseT]\r
- | InstrumentedAttribute[Sequence[_BaseT]]\r
- | InstrumentedAttribute[_BaseT | None]\r
-)\r
+RelationshipType = Union[\r
+ InstrumentedAttribute[_BaseT],\r
+ InstrumentedAttribute[Sequence[_BaseT]],\r
+ InstrumentedAttribute[Union[_BaseT, None]],\r
+]\r
\r
\r
def operate_on_relationships(\r
- relationships: list[RelationshipType[_BaseT]],\r
+ relationships: List[RelationshipType[_BaseT]],\r
) -> int:\r
return len(relationships)\r
\r