bytecode
latest
  • Bytecode Usage
  • Control Flow Graph (CFG)
  • Bytecode API
  • Peephole Optimizer
  • Comparison with byteplay and codetransformer
  • ChangeLog
  • TODO list
bytecode
  • Docs »
  • bytecode
  • Edit on GitHub

bytecode¶

bytecode is a Python module to generate and modify bytecode.

  • bytecode project homepage at GitHub (code, bugs)

  • bytecode documentation (this documentation)

  • Download latest bytecode release at the Python Cheeseshop (PyPI)

Table Of Contents¶

  • Bytecode Usage
    • Installation
    • Hello World
      • Abstract bytecode
      • Concrete bytecode
      • Setting the compiler flags
    • Simple loop
    • Conditional jump
  • Control Flow Graph (CFG)
    • Example
    • Analyze the control flow graph
      • Iterate on basic blocks
      • Browse the graph
  • Bytecode API
    • Constants
    • Functions
    • Instruction classes
      • Instr
      • ConcreteInstr
      • Compare
      • Label
      • SetLineno
    • Bytecode classes
      • BaseBytecode
      • Bytecode
      • ConcreteBytecode
      • BasicBlock
      • ControlFlowGraph
    • Cell and Free Variables
      • CellVar
      • FreeVar
    • Line Numbers
    • Compiler Flags
  • Peephole Optimizer
    • API
    • Example
    • Optimizations
  • Comparison with byteplay and codetransformer
    • History of the bytecode API design
    • byteplay and codetransformer
      • Free and cell variables
      • Line numbers
      • Jump targets
      • Control flow graph
      • Functions or methods
  • ChangeLog
    • unreleased: Version 0.12.0
    • 2020-03-02: Version 0.11.0
    • 2020-02-02: Version 0.10.0
    • 2019-12-01: Version 0.9.0
    • 2019-02-18: Version 0.8.0
    • 2018-04-15: Version 0.7.0
    • 2018-03-24: Version 0.6
    • 2017-01-05: Version 0.5
    • 2016-04-12: Version 0.4
    • 2016-03-02: Version 0.3
    • 2016-02-29: Version 0.2
    • 2016-02-26: Version 0.1
    • 2016-02-23: Release 0.0
  • TODO list

See also¶

  • codetransformer

  • byteplay

  • byteasm: an “assembler” for Python 3 bytecodes.

  • BytecodeAssembler

  • PEP 511 – API for code transformers

Next

© Copyright 2016-2020, Victor Stinner Revision 719ec83b.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
stable
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.