-
-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathMETADATA
More file actions
77 lines (63 loc) · 2.86 KB
/
METADATA
File metadata and controls
77 lines (63 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Metadata-Version: 2.1
Name: bytecode
Version: 0.13.0.dev0
Summary: Python module to generate and modify bytecode
Home-page: https://github.com/MatthieuDartiailh/bytecode
Author: Victor Stinner
Author-email: victor.stinner@gmail.com
Maintainer: Matthieu C. Dartiailh
Maintainer-email: m.dartiailh@gmail.com
License: MIT license
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
********
bytecode
********
.. image:: https://img.shields.io/pypi/v/bytecode.svg
:alt: Latest release on the Python Cheeseshop (PyPI)
:target: https://pypi.python.org/pypi/bytecode
.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Continuous%20Integration/badge.svg
:target: https://github.com/MatthieuDartiailh/bytecode/actions
:alt: Continuous integration
.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Documentation%20building/badge.svg
:target: https://github.com/MatthieuDartiailh/bytecode/actions
:alt: Documentation building
.. image:: https://img.shields.io/codecov/c/github/MatthieuDartiailh/bytecode/master.svg
:alt: Code coverage of bytecode on codecov.io
:target: https://codecov.io/github/MatthieuDartiailh/bytecode
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:alt: Code formatted using Black
:target: https://github.com/psf/black
``bytecode`` is a Python module to generate and modify bytecode.
* `bytecode project homepage at GitHub
<https://github.com/MatthieuDartiailh/bytecode>`_ (code, bugs)
* `bytecode documentation
<https://bytecode.readthedocs.io/>`_
* `Download latest bytecode release at the Python Cheeseshop (PyPI)
<https://pypi.python.org/pypi/bytecode>`_
Install bytecode: ``python3 -m pip install bytecode``. It requires Python 3.6
or newer. 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!')``:
.. code:: python
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)