Skip to content

Commit 9ad4861

Browse files
committed
Use legacy type union notation for defining types
1 parent 9e1e8cb commit 9ad4861

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

linkml_runtime/utils/schemaview.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from enum import Enum
1515
from functools import lru_cache
1616
from pathlib import Path, PurePath
17-
from typing import TYPE_CHECKING, Any, TypeVar
17+
from typing import TYPE_CHECKING, Any, TypeVar, Union
1818

1919
from deprecated.classic import deprecated
2020

@@ -66,16 +66,16 @@
6666

6767
WINDOWS = sys.platform == "win32"
6868

69-
CLASS_NAME = ClassDefinitionName | str
70-
SLOT_NAME = SlotDefinitionName | str
71-
SUBSET_NAME = SubsetDefinitionName | str
72-
TYPE_NAME = TypeDefinitionName | str
73-
ENUM_NAME = EnumDefinitionName | str
69+
CLASS_NAME = Union[ClassDefinitionName, str]
70+
SLOT_NAME = Union[SlotDefinitionName, str]
71+
SUBSET_NAME = Union[SubsetDefinitionName, str]
72+
TYPE_NAME = Union[TypeDefinitionName, str]
73+
ENUM_NAME = Union[EnumDefinitionName, str]
7474

7575
ElementType = TypeVar("ElementType", bound=Element)
76-
ElementNameType = TypeVar("ElementNameType", bound=ElementName | str)
76+
ElementNameType = TypeVar("ElementNameType", bound=Union[ElementName, str])
7777
DefinitionType = TypeVar("DefinitionType", bound=Definition)
78-
DefinitionNameType = TypeVar("DefinitionNameType", bound=DefinitionName | str)
78+
DefinitionNameType = TypeVar("DefinitionNameType", bound=Union[DefinitionName, str])
7979
ElementDict = dict[ElementNameType, ElementType]
8080
DefDict = dict[DefinitionNameType, DefinitionType]
8181

0 commit comments

Comments
 (0)