mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 23:27:45 +00:00
Pull type definitions used for Generic[SubmobjectType] outside of if TYPE_CHECKING block
This commit is contained in:
parent
8417369da1
commit
2966f358a3
2 changed files with 7 additions and 5 deletions
|
|
@ -46,9 +46,12 @@ from manimlib.utils.space_ops import get_norm
|
|||
from manimlib.utils.space_ops import rotation_matrix_transpose
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TypeVar, Generic
|
||||
SubmobjectType = TypeVar('SubmobjectType', bound='Mobject')
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable, Iterable, Iterator, Union, Tuple, Optional, TypeVar, Generic, List
|
||||
from typing import Callable, Iterable, Iterator, Union, Tuple, Optional
|
||||
import numpy.typing as npt
|
||||
from manimlib.typing import ManimColor, Vect3, Vect4, Vect3Array, UniformDict, Self
|
||||
from moderngl.context import Context
|
||||
|
|
@ -57,7 +60,6 @@ if TYPE_CHECKING:
|
|||
TimeBasedUpdater = Callable[["Mobject", float], "Mobject" | None]
|
||||
NonTimeUpdater = Callable[["Mobject"], "Mobject" | None]
|
||||
Updater = Union[TimeBasedUpdater, NonTimeUpdater]
|
||||
SubmobjectType = TypeVar('SubmobjectType', bound='Mobject')
|
||||
|
||||
|
||||
class Mobject(object):
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ from manimlib.utils.space_ops import get_norm
|
|||
from manimlib.utils.space_ops import get_unit_normal
|
||||
from manimlib.utils.space_ops import line_intersects_path
|
||||
from manimlib.utils.space_ops import midpoint
|
||||
from manimlib.utils.space_ops import normalize_along_axis
|
||||
from manimlib.utils.space_ops import rotation_between_vectors
|
||||
from manimlib.utils.space_ops import poly_line_length
|
||||
from manimlib.utils.space_ops import z_to_vector
|
||||
|
|
@ -48,12 +47,13 @@ from manimlib.shader_wrapper import ShaderWrapper
|
|||
from manimlib.shader_wrapper import FillShaderWrapper
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Generic, TypeVar
|
||||
SubVmobjectType = TypeVar('SubVmobjectType', bound='VMobject')
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable, Iterable, Tuple, Any, Generic, TypeVar
|
||||
from typing import Callable, Iterable, Tuple, Any
|
||||
from manimlib.typing import ManimColor, Vect3, Vect4, Vect3Array, Vect4Array, Self
|
||||
from moderngl.context import Context
|
||||
SubVmobjectType = TypeVar('SubVmobjectType', bound='VMobject')
|
||||
|
||||
DEFAULT_STROKE_COLOR = GREY_A
|
||||
DEFAULT_FILL_COLOR = GREY_C
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue