A community-maintained Python framework for creating mathematical animations.
Fix typehint of `Vector` direction parameter (#3640)
adeshpandeef675b64f063
diff --git a/manim/mobject/geometry/line.py b/manim/mobject/geometry/line.pyindex 93b0d73bf..2989dcb44 100644--- a/manim/mobject/geometry/line.py+++ b/manim/mobject/geometry/line.py@@ -17,7 +17,6 @@ __all__ = [from typing import TYPE_CHECKINGimport numpy as np-from typing_extensions import Selffrom manim import configfrom manim.constants import *@@ -31,6 +30,8 @@ from manim.utils.color import WHITEfrom manim.utils.space_ops import angle_of_vector, line_intersection, normalizeif TYPE_CHECKING:+ from typing_extensions import Self+from manim.typing import Point2D, Point3D, Vector3Dfrom manim.utils.color import ParsableManimColor@@ -659,7 +660,9 @@ class Vector(Arrow):self.add(plane, vector_1, vector_2)"""- def __init__(self, direction: Vector3D = RIGHT, buff: float = 0, **kwargs) -> None:+ def __init__(+ self, direction: Point2D | Point3D = RIGHT, buff: float = 0, **kwargs+ ) -> None:self.buff = buffif len(direction) == 2:direction = np.hstack([direction, 0])