def myFunc( a, b ):
def innerFunc( c ):
print c
innerFunc( 2 )
print a, b
How can I access the inner function directly? I want the object/address of that function in the format
<function innerFunc at 0xa0d5fb4>
I tried with myFunc._getattr_( ‘innerFunc’ ) but that didn’t work.
what you could do is either return the function or attach it to its parent when called …
though apparently you can access the source code using a special attribute, that function objects have …
myFunc.func_codethough this seems to be accessing some serious stuff