Changeset 388 for python/vendor/current/Lib/dis.py
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Lib/dis.py
r2 r388 7 7 from opcode import __all__ as _opcodes_all 8 8 9 __all__ = ["dis","disassemble","distb","disco"] + _opcodes_all 9 __all__ = ["dis", "disassemble", "distb", "disco", 10 "findlinestarts", "findlabels"] + _opcodes_all 10 11 del _opcodes_all 12 13 _have_code = (types.MethodType, types.FunctionType, types.CodeType, 14 types.ClassType, type) 11 15 12 16 def dis(x=None): … … 19 23 distb() 20 24 return 21 if type(x) is types.InstanceType:25 if isinstance(x, types.InstanceType): 22 26 x = x.__class__ 23 27 if hasattr(x, 'im_func'): … … 29 33 items.sort() 30 34 for name, x1 in items: 31 if type(x1) in (types.MethodType, 32 types.FunctionType, 33 types.CodeType, 34 types.ClassType): 35 if isinstance(x1, _have_code): 35 36 print "Disassembly of %s:" % name 36 37 try:
Note:
See TracChangeset
for help on using the changeset viewer.