Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

remove Scene.set_variables_as_attrs() (#692)

Leo Torresaf3cc3dbfa93
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index 36e101980..44d6c5d53 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -35,7 +35,7 @@ Mobjects, Scenes, and Animations
#. **New**: Variations of :class:`~.Dot` have been added as :class:`~.AnnotationDot`
(a bigger dot with bolder stroke) and :class:`~.LabeledDot` (a dot containing a
label).
-
+#. Scene.set_variables_as_attrs has been removed (via :pr:`692`).
diff --git a/manim/scene/scene.py b/manim/scene/scene.py
index 4cafa2193..ee6983feb 100644
--- a/manim/scene/scene.py
+++ b/manim/scene/scene.py
@@ -123,21 +123,6 @@ class Scene(Container):
def __str__(self):
return self.__class__.__name__
- def set_variables_as_attrs(self, *objects, **newly_named_objects):
- """
- This method is slightly hacky, making it a little easier
- for certain methods (typically subroutines of construct)
- to share local variables.
- """
- caller_locals = inspect.currentframe().f_back.f_locals
- for key, value in list(caller_locals.items()):
- for o in objects:
- if value is o:
- setattr(self, key, value)
- for key, value in list(newly_named_objects.items()):
- setattr(self, key, value)
- return self
-
def get_attrs(self, *keys):
"""
Gets attributes of a scene given the attribute's identifier/name.