Skip to content

Commit 0504b89

Browse files
committed
Type annotations on scene/vector_space_scene.py
1 parent ef59523 commit 0504b89

File tree

4 files changed

+137
-87
lines changed

4 files changed

+137
-87
lines changed

manim/animation/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def __init__(
519519
function: types.MethodType,
520520
mobject: Mobject,
521521
run_time: float = DEFAULT_POINTWISE_FUNCTION_RUN_TIME,
522-
**kwargs,
522+
**kwargs: Any,
523523
) -> None:
524524
super().__init__(mobject.apply_function, function, run_time=run_time, **kwargs)
525525

manim/mobject/matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def get_mob_matrix(self):
410410
"""
411411
return self.mob_matrix
412412

413-
def get_entries(self):
413+
def get_entries(self) -> VGroup:
414414
"""Return the individual entries of the matrix.
415415
416416
Returns
@@ -435,7 +435,7 @@ def construct(self):
435435
"""
436436
return self.elements
437437

438-
def get_brackets(self):
438+
def get_brackets(self) -> VGroup:
439439
r"""Return the bracket mobjects.
440440
441441
Returns

manim/scene/scene.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
from collections.abc import Sequence
5656
from typing import Callable
5757

58+
from typing_extensions import Self
59+
5860
from manim.mobject.mobject import _AnimationBuilder
5961

6062

@@ -813,7 +815,7 @@ def bring_to_back(self, *mobjects: Mobject):
813815
self.mobjects = list(mobjects) + self.mobjects
814816
return self
815817

816-
def clear(self):
818+
def clear(self) -> Self:
817819
"""
818820
Removes all mobjects present in self.mobjects
819821
and self.foreground_mobjects from the scene.

0 commit comments

Comments
 (0)