Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
775c3070
Commit
775c3070
authored
Jan 01, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4222: document dis.findlabels() and dis.findlinestarts() and
put them into dis.__all__.
parent
2adde055
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
Doc/library/dis.rst
Doc/library/dis.rst
+15
-2
Lib/dis.py
Lib/dis.py
+2
-1
No files found.
Doc/library/dis.rst
View file @
775c3070
...
...
@@ -64,10 +64,23 @@ The :mod:`dis` module defines the following functions and constants:
.. function:: disco(code[, lasti])
A synonym for
disassemble. It is more convenient to type, and kept for
compatibility with earlier Python releases.
A synonym for
:func:`disassemble`. It is more convenient to type, and kept
for
compatibility with earlier Python releases.
.. function:: findlinestarts(code)
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.
.. function:: findlabels(code)
Detect all offsets in the code object *code* which are jump targets, and
return a list of these offsets.
.. data:: opname
Sequence of operation names, indexable using the bytecode.
...
...
Lib/dis.py
View file @
775c3070
...
...
@@ -6,7 +6,8 @@ import types
from
opcode
import
*
from
opcode
import
__all__
as
_opcodes_all
__all__
=
[
"dis"
,
"disassemble"
,
"distb"
,
"disco"
]
+
_opcodes_all
__all__
=
[
"dis"
,
"disassemble"
,
"distb"
,
"disco"
,
"findlinestarts"
,
"findlabels"
]
+
_opcodes_all
del
_opcodes_all
def
dis
(
x
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment