Python09-03_函数----内存底层分析
函数内存底层分析(函数也是对象)
Python中,一切都是对象。实际上执行def定义函数对象的时候,系统就创建了函数的对象。
1 def text01(): 2 print(\'Xujie\') 3 4 text01() 5 c = text01 6 c() 7 8 print(id(text01)) 9 print(id(c)) 10 print(type(c))
Python中,一切都是对象。实际上执行def定义函数对象的时候,系统就创建了函数的对象。
1 def text01(): 2 print(\'Xujie\') 3 4 text01() 5 c = text01 6 c() 7 8 print(id(text01)) 9 print(id(c)) 10 print(type(c))
相关文章: