It is important to note that Python is the language of the interpretation type. Allows function A to call function B without defining a B function before defining a function.
def func1(): print"Hello fun1" fun2()def func2(): print"Hello func2"fun1()
It is possible to do so. But imagine if function 2 also calls function 1?
As follows:
def func1(): print"Hello fun1" fun2()def func2(): print"Hello func2" fun1()fun1()
This is a nested call. Will explode the stack of ...
Because it is not a compiled language, this problem is difficult to pre-parse the syntax, it is likely that python in order to pursue speed, not to analyze the error.
So when writing a program, pay special attention to not nesting calls between two or more functions ...
Of course, I didn't do it, I just tried it, so python can actually nest defined functions.
Python's nesting function for stepping on pits