# pydoc > opcode

---
type: CommandReference
command: opcode
mode: pydoc
section: ""
source: pydoc3
---

## Quick Reference
- `opmap` — dictionary mapping opcode names to opcode numbers
- `opname` — list of opcode names indexed by opcode number
- `cmp_op` — tuple of comparison operator strings
- `stack_effect(opcode, oparg=None)` — compute the stack effect of an opcode

## Name
opcode — Python bytecode opcode utilities

## Synopsis
The `opcode` module defines bytecode opcodes and related data for Python 3.10.

## Options
- `opmap` — mapping from opcode name to opcode number (e.g., `opmap['POP_TOP'] == 1`)
- `opname` — list of opcode names by number (e.g., `opname[1] == 'POP_TOP'`)
- `cmp_op` — tuple of comparison operators: `('<', '<=', '==', '!=', '>', '>=')`
- `stack_effect(opcode, oparg=None)` — compute the stack effect of the opcode
- `hasconst` — list of opcodes that load constants: `[100]`
- `hascompare` — list of opcodes that compare: `[107]`
- `hasname` — list of opcodes that reference names: `[90, 91, 95, 96, 97, 98, 101, 106, 108, 109, 116, 160]`
- `hasjrel` — list of opcodes with relative jumps: `[93, 110, 122, 143, 154]`
- `hasjabs` — list of opcodes with absolute jumps: `[111, 112, 113, 114, 115, 121]`
- `haslocal` — list of opcodes that access local variables: `[124, 125, 126]`
- `hasfree` — list of opcodes that access free variables: `[135, 136, 137, 138, 148]`
- `EXTENDED_ARG` — opcode for extended argument: `144`
- `HAVE_ARGUMENT` — opcodes greater than or equal to this have an argument: `90`

## Examples
python
>>> import opcode
>>> opcode.opmap['POP_TOP']
1
>>> opcode.opname[1]
'POP_TOP'
>>> opcode.cmp_op
('<', '<=', '==', '!=', '>', '>=')
## See Also
- `dis` module — Python disassembler
- [Python bytecode reference](https://docs.python.org/3.10/library/dis.html#opcodes)