A community-maintained Python framework for creating mathematical animations.
Fix typehint of :meth:`.Scene.play` to allow `.animate` (#4038)
Aarush Deshpande6abcc611b91f
diff --git a/manim/renderer/cairo_renderer.py b/manim/renderer/cairo_renderer.pyindex 0b13fb863..6625a49eb 100644--- a/manim/renderer/cairo_renderer.py+++ b/manim/renderer/cairo_renderer.py@@ -8,14 +8,12 @@ from manim.utils.hashing import get_hash_from_play_callfrom .. import config, loggerfrom ..camera.camera import Camera-from ..mobject.mobject import Mobject+from ..mobject.mobject import Mobject, _AnimationBuilderfrom ..scene.scene_file_writer import SceneFileWriterfrom ..utils.exceptions import EndSceneEarlyExceptionfrom ..utils.iterables import list_updateif typing.TYPE_CHECKING:- import types- from collections.abc import Iterablefrom typing import Anyfrom manim.animation.animation import Animation@@ -60,7 +58,7 @@ class CairoRenderer:def play(self,scene: Scene,- *args: Animation | Iterable[Animation] | types.GeneratorType[Animation],+ *args: Animation | Mobject | _AnimationBuilder,**kwargs,):# Reset skip_animations to the original state.diff --git a/manim/scene/scene.py b/manim/scene/scene.pyindex e70c3beb1..bf8e526bf 100644--- a/manim/scene/scene.py+++ b/manim/scene/scene.py@@ -52,9 +52,11 @@ from ..utils.file_ops import open_media_filefrom ..utils.iterables import list_difference_update, list_updateif TYPE_CHECKING:- from collections.abc import Iterable, Sequence+ from collections.abc import Sequencefrom typing import Callable+ from manim.mobject.mobject import _AnimationBuilder+class RerunSceneHandler(FileSystemEventHandler):"""A class to handle rerunning a Scene after the input file is modified."""@@ -878,7 +880,7 @@ class Scene:def compile_animations(self,- *args: Animation | Iterable[Animation] | types.GeneratorType[Animation],+ *args: Animation | Mobject | _AnimationBuilder,**kwargs,):"""@@ -1070,7 +1072,7 @@ class Scene:def play(self,- *args: Animation | Iterable[Animation] | types.GeneratorType[Animation],+ *args: Animation | Mobject | _AnimationBuilder,subcaption=None,subcaption_duration=None,subcaption_offset=0,@@ -1205,7 +1207,7 @@ class Scene:def compile_animation_data(self,- *animations: Animation | Iterable[Animation] | types.GeneratorType[Animation],+ *animations: Animation | Mobject | _AnimationBuilder,**play_kwargs,):"""Given a list of animations, compile the corresponding