summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-07-02 22:03:00 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-07-02 22:03:00 (GMT)
commit8315fd12a5a5dd612fecd12677a01c1b06d5b71d (patch)
tree51449dbd858e97c0e18265581db2e77e25eadb65 /Doc
parentbe5846bfdc90bb4216a179dcc3ced11bf4aaaf8c (diff)
downloadcpython-8315fd12a5a5dd612fecd12677a01c1b06d5b71d.zip
cpython-8315fd12a5a5dd612fecd12677a01c1b06d5b71d.tar.gz
cpython-8315fd12a5a5dd612fecd12677a01c1b06d5b71d.tar.bz2
Some people have mistaken Python bytecode as being stable and unchanging. In
reality it's simply an implementation detail for CPython. This point is now clearly documented in both the docs for dis and the glossary. Closes issue #7829. Thanks to Terry Reedy for some initial suggestions on wording.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/glossary.rst13
-rw-r--r--Doc/library/dis.rst7
2 files changed, 12 insertions, 8 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 8363714..98744eb 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -57,11 +57,14 @@ Glossary
bytecode
Python source code is compiled into bytecode, the internal representation
- of a Python program in the interpreter. The bytecode is also cached in
- ``.pyc`` and ``.pyo`` files so that executing the same file is faster the
- second time (recompilation from source to bytecode can be avoided). This
- "intermediate language" is said to run on a :term:`virtual machine`
- that executes the machine code corresponding to each bytecode.
+ of a Python program in the CPython interpreter. The bytecode is also
+ cached in ``.pyc`` and ``.pyo`` files so that executing the same file is
+ faster the second time (recompilation from source to bytecode can be
+ avoided). This "intermediate language" is said to run on a
+ :term:`virtual machine` that executes the machine code corresponding to
+ each bytecode. Do note that bytecodes are not expected to work between
+ different Python virtual machines, nor to be stable between Python
+ releases.
class
A template for creating user-defined objects. Class definitions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index b62a673..c9417ea 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -5,12 +5,13 @@
:synopsis: Disassembler for Python bytecode.
-The :mod:`dis` module supports the analysis of Python :term:`bytecode` by
-disassembling it. Since there is no Python assembler, this module defines the
-Python assembly language. The Python bytecode which this module takes as an
+The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by
+disassembling it. The CPython bytecode which this module takes as an
input is defined in the file :file:`Include/opcode.h` and used by the compiler
and the interpreter.
+.. warning:: Bytecode is an implementation detail of the CPython interpreter! No guarantees are made that bytecode will not be added, removed, or changed between versions of Python. Use of this module should not be considered to work across Python VMs or Python releases.
+
Example: Given the function :func:`myfunc`::
def myfunc(alist):