I do not think that you can check the code object, because the internal functions are lazy, and their code objects are created only in time. Instead, you most likely want to take a look at the ast module. Here is a quick example:
import ast, inspect
Results: function1, function2, f1_var1, function3, f2_var1, f2_var2, f3_var1. Mandatory disclaimer: there is probably no good reason for this kind of thing .. but have fun :)
Oh, and if you only need internal function names?
print dict([[x.name,x] for x in ast.walk(ast.parse(inspect.getsource(some_function))) if type(x).__name__=='FunctionDef'])
source share