随笔分类 - Python底层代码解析
摘要:普通函数的code本地存储情况 def f(): pass print(f.__code__) #<code object f at 0x0000018A7AC6F1B0, file "E:\zwx901323\test_position\easy.py", line 1> print(dir(f.
阅读全文
摘要:Python代码,底层的编译实现过程 from dis import dis def add(a, b): return a + b dis(add) """ 栈里保存a,b 5 0 LOAD_FAST 0 (a) 2 LOAD_FAST 1 (b) 4 BINARY_ADD 6 RETURN_VA
阅读全文