diff options
Diffstat (limited to 'pypers/tracemain.py')
-rwxr-xr-x | pypers/tracemain.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pypers/tracemain.py b/pypers/tracemain.py new file mode 100755 index 0000000..9bf1068 --- /dev/null +++ b/pypers/tracemain.py @@ -0,0 +1,7 @@ +from oopp import ClsFactory,Traced,Reflective +def f1(x): return x # nested functions +def f2(x): return f1(x) # we want to trace +f1orf2=lambda k,v : v is f1 or v is f2 +make=ClsFactory[Reflective,Traced.With(condition=f1orf2)] +traced=make('traced',globals()) +traced.f2('hello!') # call traced.f2 |