summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-05-10 14:16:47 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-05-10 14:16:47 (GMT)
commite1577fb20f662ad0565455f8d74366495c1d424b (patch)
tree69fef442832df0d50531d1a0bd394f43b54436d1 /Lib/dis.py
parente3f68a1a96bd55d9fbd2537935999d205bf266f9 (diff)
downloadcpython-e1577fb20f662ad0565455f8d74366495c1d424b.zip
cpython-e1577fb20f662ad0565455f8d74366495c1d424b.tar.gz
cpython-e1577fb20f662ad0565455f8d74366495c1d424b.tar.bz2
use isinstance
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index e60e702..edc210f 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -19,7 +19,7 @@ def dis(x=None):
if x is None:
distb()
return
- if type(x) is types.InstanceType:
+ if isinstance(x, types.InstanceType):
x = x.__class__
if hasattr(x, 'im_func'):
x = x.im_func
@@ -29,10 +29,10 @@ def dis(x=None):
items = x.__dict__.items()
items.sort()
for name, x1 in items:
- if type(x1) in (types.MethodType,
- types.FunctionType,
- types.CodeType,
- types.ClassType):
+ if isinstance(x1, (types.MethodType,
+ types.FunctionType,
+ types.CodeType,
+ types.ClassType)):
print "Disassembly of %s:" % name
try:
dis(x1)