引子:
在python的世界里,函数和我们之前的[1,2,3],‘abc‘,8等一样都是对象,而且函数是最高级的对象(对象是类的实例化,可以调用相应的方法,函数是包含变量对象的对象,牛逼!)
def foo(): print(‘i am the foo‘) bar() def bar(): print(‘i am the bar‘) foo() # def bar(): #报错 # print(‘i am the bar‘)
带着这个问题,我们聊一聊函数在内存的存储情况:
原文:https://www.cnblogs.com/baijinshuo/p/10491256.html