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
7b98e8c2
Commit
7b98e8c2
authored
Sep 12, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show names of locals in disco (Ka-Ping Yee)
parent
6a10f1dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
Lib/dis.py
Lib/dis.py
+6
-0
No files found.
Lib/dis.py
View file @
7b98e8c2
...
...
@@ -40,6 +40,8 @@ def disassemble(co, lasti):
print
'('
+
co
.
co_names
[
oparg
]
+
')'
,
elif
op
in
hasjrel
:
print
'(to '
+
`i + oparg`
+
')'
,
elif
op
in
haslocal
:
print
'('
+
co
.
co_varnames
[
oparg
]
+
')'
,
print
def
findlabels
(
code
):
...
...
@@ -67,6 +69,7 @@ hasconst = []
hasname
=
[]
hasjrel
=
[]
hasjabs
=
[]
haslocal
=
[]
opname
=
[
''
]
*
256
for
op
in
range
(
256
):
opname
[
op
]
=
'<'
+
`op`
+
'>'
...
...
@@ -183,8 +186,11 @@ jrel_op('SETUP_FINALLY', 122) # ""
def_op
(
'RESERVE_FAST'
,
123
)
# Number of local variables
hasconst
.
append
(
123
)
def_op
(
'LOAD_FAST'
,
124
)
# Local variable number
haslocal
.
append
(
124
)
def_op
(
'STORE_FAST'
,
125
)
# Local variable number
haslocal
.
append
(
125
)
def_op
(
'DELETE_FAST'
,
126
)
# Local variable number
haslocal
.
append
(
126
)
def_op
(
'SET_LINENO'
,
127
)
# Current line number
SET_LINENO
=
127
...
...
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