From ffbe5c8114c2940d7f011c58e4ab4eec457bcbee Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sat, 2 Mar 2024 16:49:35 -0500 Subject: [PATCH] Add type hints for affects_mobject_list --- manimlib/scene/scene.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index cd95eef0..7dc4f2d6 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -44,9 +44,11 @@ from manimlib.utils.iterables import batch_by_property from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Callable, Iterable + from typing import Callable, Iterable, TypeVar from manimlib.typing import Vect3 + T = TypeVar('T') + from PIL.Image import Image from manimlib.animation.animation import Animation @@ -399,7 +401,8 @@ class Scene(object): for batch, key in batches ] - def affects_mobject_list(func: Callable): + @staticmethod + def affects_mobject_list(func: Callable[..., T]) -> Callable[..., T]: @wraps(func) def wrapper(self, *args, **kwargs): func(self, *args, **kwargs)