what you could do is either return the function or attach it to its parent when called ...
>>> def myFunc( a, b ):
... def innerFunc( c ):
... print c
... innerFunc( 2 )
... myFunc.innerFunc = innerFunc
... print a, b
...
>>>
>>> myFunc(1,2)
2
1 2
>>> myFunc.innerFunc(3)
3
>>>
though apparently you can access the source code using a special attribute, that function objects have ... myFunc.func_code
though this seems to be accessing some serious stuff
>>> help(myFunc.func_code)
Help on code object:
class code(object)
| code(argcount, nlocals, stacksize, flags, codestring, constants, names,
| varnames, filename, name, firstlineno, lnotab[, freevars[, cellvars]])
|
| Create a code object. Not for the faint of heart.
|