dis.code_info()
dis.code_info() is a Python function in the Dis Module category. Returns detailed information about a code object. The syntax is dis.code_info(x). Returns: Formatted info string. A typical example: print(dis.code_info(hello))
# Shows filename, names, varnames, etc.. A close sibling is dis.dis(), which disassembles Python bytecode for a function, generator, class, method, or code object. A close sibling is dis.get_instructions(), which returns an iterator over bytecode instructions for analysis. A close sibling is dis.show_code(), which prints detailed code object information. A close sibling is dis.Bytecode(), which creates a Bytecode object for analyzing bytecode. More about this category: Bytecode disassembler — dis, get_instructions, code_info. Related Dis Module entries: dis.dis(), dis.get_instructions(), dis.show_code(), dis.Bytecode(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try dis.code_info() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.