Skip to content

MatthieuDartiailh/bytecode

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

* Fix rare extended_arg NOPs not being processable by concrete._remove_extended_args

Signed-off-by: EmmaJaneBonestell <EmmaJaneBonestell@gmail.com>

* Properly version types.CodeType arguments for test_extended_arg_nop

Signed-off-by: EmmaJaneBonestell <EmmaJaneBonestell@gmail.com>

---------

Signed-off-by: EmmaJaneBonestell <EmmaJaneBonestell@gmail.com>
6afe999

Git stats

Files

Permalink
Failed to load latest commit information.

bytecode

Latest release on the Python Cheeseshop (PyPI) Continuous integration Documentation building Code coverage of bytecode on codecov.io Code formatted using Black

bytecode is a Python module to generate and modify bytecode.

Install bytecode: python3 -m pip install bytecode. It requires Python 3.8 or newer. The latest release that supports Python 3.7 and 3.6 is 0.13.0. The latest release that supports Python 3.5 is 0.12.0. For Python 2.7 support, have a look at`dead-bytecode <https://github.com/p403n1x87/dead-bytecode>`_ instead.

Example executing print('Hello World!'):

from bytecode import Instr, Bytecode

bytecode = Bytecode([Instr("LOAD_NAME", 'print'),
                     Instr("LOAD_CONST", 'Hello World!'),
                     Instr("CALL_FUNCTION", 1),
                     Instr("POP_TOP"),
                     Instr("LOAD_CONST", None),
                     Instr("RETURN_VALUE")])
code = bytecode.to_code()
exec(code)