def f(x): print 'original' if x > 0: return f(x-1) return 0 g = f def f(x): print 'new' return x print g(5)
结果是:
original
new
4
证明了:
1.when g(5) runs, origninal `f`is called,not new `f`.
2.as 5>0,'return f(x-1)'is executed
3.new`f`is called when `f(x-1)` runs. so the result is 4.