李昂 0e1a2d3249 !110 support default pars for py function
* var_default_vars test ok
* default with input is ok
* use self.val in CallBack/test2.py
* vm ...
2022-09-02 16:16:31 +00:00

37 lines
643 B
Python

class Demo():
def __init__(self):
print("__init__")
self.funcs = []
self.funcs.append(self.a)
self.funcs.append(self.b)
self.funcs.append(self.c)
self.val = 'ppp'
def a(self):
print('a')
def b(self):
print('b')
def c(self):
print(self.val)
def get_funcs(self):
return self.funcs
class Test():
def funcs_test(self):
demo = Demo()
funcs = demo.get_funcs()
print('----------------------------')
for func in funcs:
demo.func = func
demo.func()
test = Test()
test.funcs_test()