首页 > 编程语言 >Python字节码与虚拟机

Python字节码与虚拟机

时间:2022-12-31 08:33:32浏览次数:38  
标签:LOAD 字节 Python 虚拟机 FAST add dis

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_VALUE
"""

 

标签:LOAD,字节,Python,虚拟机,FAST,add,dis
From: https://www.cnblogs.com/zwx901323/p/17016194.html

相关文章