# Python Dis Module (Disassembler)

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 compiler and the interpreter.

## Importing the Module

```python
import dis
```

## Disassembling Functions

The `dis.dis()` function disassembles a class, method, function, or code object.

```python
import dis

def myfunc(alist):
    return len(alist)

dis.dis(myfunc)
```

**Output Explanation:**
The output typically consists of columns indicating:
1.  The line number in the source code.
2.  The address of the instruction.
3.  The opcode name.
4.  The argument (if any).
5.  The human-readable interpretation of the argument.

## Inspecting Code Objects

You can inspect the code object details using `dis.show_code()`.

```python
import dis

def add(a, b):
    return a + b

dis.show_code(add)
```

## Command Line Usage

You can also use `dis` as a script from the command line.

```bash
python -m dis myscript.py
```

[[programming/python/python]]