diff --git a/manim/typing.py b/manim/typing.py index 553c868d02..9c42ee1af0 100644 --- a/manim/typing.py +++ b/manim/typing.py @@ -1,7 +1,7 @@ from __future__ import annotations from os import PathLike -from typing import Callable +from typing import Callable, Tuple, Union import numpy as np import numpy.typing as npt @@ -14,16 +14,16 @@ ManimColorDType: TypeAlias = ManimFloat RGB_Array_Float: TypeAlias = npt.NDArray[ManimFloat] -RGB_Tuple_Float: TypeAlias = tuple[float, float, float] +RGB_Tuple_Float: TypeAlias = Tuple[float, float, float] RGB_Array_Int: TypeAlias = npt.NDArray[ManimInt] -RGB_Tuple_Int: TypeAlias = tuple[int, int, int] +RGB_Tuple_Int: TypeAlias = Tuple[int, int, int] RGBA_Array_Float: TypeAlias = npt.NDArray[ManimFloat] -RGBA_Tuple_Float: TypeAlias = tuple[float, float, float, float] +RGBA_Tuple_Float: TypeAlias = Tuple[float, float, float, float] RGBA_Array_Int: TypeAlias = npt.NDArray[ManimInt] -RGBA_Tuple_Int: TypeAlias = tuple[int, int, int, int] +RGBA_Tuple_Int: TypeAlias = Tuple[int, int, int, int] HSV_Array_Float: TypeAlias = RGB_Array_Float HSV_Tuple_Float: TypeAlias = RGB_Tuple_Float @@ -110,5 +110,5 @@ Image: TypeAlias = np.ndarray """An Image""" -StrPath: TypeAlias = str | PathLike[str] -StrOrBytesPath: TypeAlias = str | bytes | PathLike[str] | PathLike[bytes] +StrPath: TypeAlias = Union[str, PathLike[str]] +StrOrBytesPath: TypeAlias = Union[str, bytes, PathLike[str], PathLike[bytes]]