My code (minimal example) looks like this:
class Hello:
a=1
b=2
c=3
def __init__(self):
self.d= 4
and I am searching for a function like set_all_vars_to_self_vars()
which I can call in the class Hello
, so that the Hello
class becomes equvilent to:
class Hello:
def __init__(self):
self.d = 4
self.a = 1
self.b = 2
self.c = 3
Is there some functionality that does that?
The rich example looks like this:
from manim import *
class Scene1(Scene):
def construct(self):
dot = Dot()
circ= Circle()
self.add(dot,circ)
self.set_variables_as_attrs(dot) # at the moment, variables have to be added manually
return self
class Scene2(Scene):
def construct(self):
sc1 = Scene1.construct(self)
dot2= Dot().next_to(sc1.dot)
self.play(ShowCreation(dot2))