66
77
88import copy
9+ import inspect
910import itertools as it
1011import math
1112import operator as op
3637from ..utils .exceptions import MultiAnimationOverrideException
3738from ..utils .iterables import list_update , remove_list_redundancies
3839from ..utils .paths import straight_path
39- from ..utils .simple_functions import get_parameters
4040from ..utils .space_ops import angle_between_vectors , normalize , rotation_matrix
4141
4242# TODO: Explain array_attrs
@@ -847,8 +847,7 @@ def update(self, dt: float = 0, recursive: bool = True) -> Self:
847847 if self .updating_suspended :
848848 return self
849849 for updater in self .updaters :
850- parameters = get_parameters (updater )
851- if "dt" in parameters :
850+ if "dt" in inspect .signature (updater ).parameters :
852851 updater (self , dt )
853852 else :
854853 updater (self )
@@ -873,7 +872,11 @@ def get_time_based_updaters(self) -> list[TimeBasedUpdater]:
873872 :meth:`has_time_based_updater`
874873
875874 """
876- return [updater for updater in self .updaters if "dt" in get_parameters (updater )]
875+ return [
876+ updater
877+ for updater in self .updaters
878+ if "dt" in inspect .signature (updater ).parameters
879+ ]
877880
878881 def has_time_based_updater (self ) -> bool :
879882 """Test if ``self`` has a time based updater.
@@ -889,7 +892,9 @@ def has_time_based_updater(self) -> bool:
889892 :meth:`get_time_based_updaters`
890893
891894 """
892- return any ("dt" in get_parameters (updater ) for updater in self .updaters )
895+ return any (
896+ "dt" in inspect .signature (updater ).parameters for updater in self .updaters
897+ )
893898
894899 def get_updaters (self ) -> list [Updater ]:
895900 """Return all updaters.
@@ -982,7 +987,7 @@ def construct(self):
982987 else :
983988 self .updaters .insert (index , update_function )
984989 if call_updater :
985- parameters = get_parameters (update_function )
990+ parameters = inspect . signature (update_function ). parameters
986991 if "dt" in parameters :
987992 update_function (self , 0 )
988993 else :
0 commit comments