having a class
class MyClass:
def func_a(self):
"""do a"""
def func_b(self):
"""do b"""
and a mapping
mapping = {
"A": lambda: Myclass.do_a,
"B": lambda: Myclass.do_b
}
I would like to be able to do something like this:
thing = Myclass()
for i in ["A", "B"]:
# call things appropriate method
So in the case of ["A", "B"] first call func_a on thing, and then func_b. How could I do that?
Thanks!