diff options
author | Ivan Levkivskyi <levkivskyi@gmail.com> | 2017-03-24 21:05:04 (GMT) |
---|---|---|
committer | Brett Cannon <brettcannon@users.noreply.github.com> | 2017-03-24 21:05:04 (GMT) |
commit | 8f9e1bbf2dbdf46a0bf920279568a31460043376 (patch) | |
tree | 0ca96204e8856566350cc17f9853b9eff4a35512 /Doc/library/dis.rst | |
parent | 671079ef6063fe227460a6c3114625fb6282bbd0 (diff) | |
download | cpython-8f9e1bbf2dbdf46a0bf920279568a31460043376.zip cpython-8f9e1bbf2dbdf46a0bf920279568a31460043376.tar.gz cpython-8f9e1bbf2dbdf46a0bf920279568a31460043376.tar.bz2 |
bpo-28810: Document remaining bytecode changes in 3.6 (GH-651)
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index d37f76f..f82dc40 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -20,6 +20,10 @@ interpreter. between versions of Python. Use of this module should not be considered to work across Python VMs or Python releases. + .. versionchanged:: 3.6 + Use 2 bytes for each instruction. Previously the number of bytes varied + by instruction. + Example: Given the function :func:`myfunc`:: @@ -210,6 +214,11 @@ operation is being performed, so the intermediate analysis object isn't useful: This generator function uses the ``co_firstlineno`` and ``co_lnotab`` attributes of the code object *code* to find the offsets which are starts of lines in the source code. They are generated as ``(offset, lineno)`` pairs. + See :source:`Objects/lnotab_notes.txt` for the ``co_lnotab`` format and + how to decode it. + + .. versionchanged:: 3.6 + Line numbers can be decreasing. Before, they were always increasing. .. function:: findlabels(code) @@ -1127,8 +1136,13 @@ All of the following opcodes use their arguments. .. opcode:: HAVE_ARGUMENT This is not really an opcode. It identifies the dividing line between - opcodes which don't take arguments ``< HAVE_ARGUMENT`` and those which do - ``>= HAVE_ARGUMENT``. + opcodes which don't use their argument and those that do + (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively). + + .. versionchanged:: 3.6 + Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` + ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument. + .. _opcode_collections: |