Skip to content

Commit

Permalink
Use union syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Sep 22, 2023
1 parent 3a3d501 commit 2189d01
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import warnings
from functools import partialmethod, reduce
from pathlib import Path
from typing import TYPE_CHECKING, Callable, Iterable, Literal, TypeVar
from typing import TYPE_CHECKING, Callable, Iterable, Literal, TypeVar, Union

import numpy as np
from typing_extensions import Self
from typing_extensions import Self, TypeAlias

from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL

Expand All @@ -40,13 +40,12 @@

# TODO: Explain array_attrs

TimeBasedUpdater = Callable[["Mobject", float], None]
NonTimeBasedUpdater = Callable[["Mobject"], None]
Updater = NonTimeBasedUpdater | TimeBasedUpdater
TimeBasedUpdater: TypeAlias = Callable[["Mobject", float], None]
NonTimeBasedUpdater: TypeAlias = Callable[["Mobject"], None]
Updater: TypeAlias = Union[NonTimeBasedUpdater, TimeBasedUpdater]
T = TypeVar("T", bound="Mobject")

if TYPE_CHECKING:
from manim.mobject.types.vectorized_mobject import VMobject
from manim.typing import (
FunctionOverride,
Image,
Expand Down Expand Up @@ -111,7 +110,7 @@ def __init__(
self.submobjects = []
self.updaters: list[Updater] = []
self.updating_suspended = False
self.color: ManimColor = ManimColor.parse(color)
self.color = ManimColor.parse(color)

self.reset_points()
self.generate_points()
Expand Down

0 comments on commit 2189d01

Please sign in to comment.