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
76a23c17
Commit
76a23c17
authored
Apr 04, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dis on new style classes #8310
parent
6f65d2dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Lib/dis.py
Lib/dis.py
+4
-4
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/dis.py
View file @
76a23c17
...
...
@@ -10,6 +10,9 @@ __all__ = ["dis", "disassemble", "distb", "disco",
"findlinestarts"
,
"findlabels"
]
+
_opcodes_all
del
_opcodes_all
_have_code
=
(
types
.
MethodType
,
types
.
FunctionType
,
types
.
CodeType
,
types
.
ClassType
,
type
)
def
dis
(
x
=
None
):
"""Disassemble classes, methods, functions, or code.
...
...
@@ -29,10 +32,7 @@ def dis(x=None):
items
=
x
.
__dict__
.
items
()
items
.
sort
()
for
name
,
x1
in
items
:
if
isinstance
(
x1
,
(
types
.
MethodType
,
types
.
FunctionType
,
types
.
CodeType
,
types
.
ClassType
)):
if
isinstance
(
x1
,
_have_code
):
print
"Disassembly of %s:"
%
name
try
:
dis
(
x1
)
...
...
Misc/NEWS
View file @
76a23c17
...
...
@@ -49,6 +49,8 @@ Core and Builtins
Library
-------
- Issue #8310: Allow dis to examine new style classes.
- Issue #8257: The Decimal construct now accepts a float instance
directly, converting that float to a Decimal of equal value:
...
...
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