diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2024-12-05 15:01:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 15:01:59 (GMT) |
commit | 67b9a5331ae45aa126877d7f96a1e235600f9c4b (patch) | |
tree | 8311be1530fa2a81fab9e415c2849b40e493d653 /Doc | |
parent | fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634 (diff) | |
download | cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.zip cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.tar.gz cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.tar.bz2 |
gh-127413: allow to show specialized bytecode via `dis` CLI (#127414)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/dis.rst | 8 | ||||
-rw-r--r-- | Doc/whatsnew/3.14.rst | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e2926f2..f8f4188 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -60,6 +60,8 @@ interpreter. The :option:`-P <dis --show-positions>` command-line option and the ``show_positions`` argument were added. + The :option:`-S <dis --specialized>` command-line option is added. + Example: Given the function :func:`!myfunc`:: def myfunc(alist): @@ -89,7 +91,7 @@ The :mod:`dis` module can be invoked as a script from the command line: .. code-block:: sh - python -m dis [-h] [-C] [-O] [-P] [infile] + python -m dis [-h] [-C] [-O] [-P] [-S] [infile] The following options are accepted: @@ -111,6 +113,10 @@ The following options are accepted: Show positions of instructions in the source code. +.. cmdoption:: -S, --specialized + + Show specialized bytecode. + If :file:`infile` is specified, its disassembled code will be written to stdout. Otherwise, disassembly is performed on compiled source code received from stdin. diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 52a6d6e..e83c509 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -348,12 +348,18 @@ dis This feature is also exposed via :option:`dis --show-positions`. (Contributed by Bénédikt Tran in :gh:`123165`.) +* Add the :option:`dis --specialized` command-line option to + show specialized bytecode. + (Contributed by Bénédikt Tran in :gh:`127413`.) + + errno ----- * Add :data:`errno.EHWPOISON` error code. (Contributed by James Roy in :gh:`126585`.) + fractions --------- |