티스토리 뷰
import dis
dis.dis('a = [1, 2, 3, 4]')
"""
0 LOAD_CONST 0 (1)
2 LOAD_CONST 1 (2)
4 LOAD_CONST 2 (3)
6 LOAD_CONST 3 (4)
8 BUILD_LIST 4
10 STORE_NAME 0 (a)
12 LOAD_CONST 4 (None)
14 RETURN_VALUE
"""
dis(Disassembler for Python bytecode)
dis — Disassembler for Python bytecode — Python 3.7.4rc2 documentation
dis — Disassembler for Python bytecode Source code: Lib/dis.py The dis module supports the analysis of CPython bytecode by disassembling it. The CPython bytecode which this module takes as an input is defined in the file Include/opcode.h and used by the co
docs.python.org
'Standard Library' 카테고리의 다른 글
copy(), deepcopy() (0) | 2019.07.05 |
---|---|
JSON (0) | 2019.07.02 |
최근에 올라온 글
글 보관함