Skip to content

Fix typehint of Vector direction parameter #3640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions manim/mobject/geometry/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from typing import TYPE_CHECKING

import numpy as np
from typing_extensions import Self

from manim import config
from manim.constants import *
Expand All @@ -31,6 +30,8 @@
from manim.utils.space_ops import angle_of_vector, line_intersection, normalize

if TYPE_CHECKING:
from typing_extensions import Self

from manim.typing import Point2D, Point3D, Vector3D
from manim.utils.color import ParsableManimColor

Expand Down Expand Up @@ -659,7 +660,9 @@ def construct(self):
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 = buff
if len(direction) == 2:
direction = np.hstack([direction, 0])
Expand Down