In jupyter Notebook, I am trying to use %lprun on nested functions but I do not sucess.
The following code, in a notebook cell
def outerfoo():
def innerfoo():
print("Hello World")
print("Good Bye")
innerfoo()
%lprun -f outerfoo().innerfoo outerfoo()
outputs the messages (Hello World and GoodBye) but after I have this error :
UsageError: Could not find function 'outerfoo().innerfoo'.
AttributeError: 'NoneType' object has no attribute 'innerfoo'
And this one,
def outerfoo():
def innerfoo():
print("Hello World")
print("Good Bye")
%lprun -f innerfoo innerfoo()
outerfoo()
does not print messages and gives this error :
UsageError: Could not find function 'innerfoo'.
NameError: name 'innerfoo' is not defined
How is it possible to profile innerfoo
?