Issue #26733: Disassembling a class now disassembles class and static methods.

Patch by Xiang Zhang.
This commit is contained in:
Serhiy Storchaka 2016-04-23 09:24:29 +03:00
commit 8b9eefc363
4 changed files with 60 additions and 8 deletions

View file

@ -13,7 +13,8 @@ __all__ = ["code_info", "dis", "disassemble", "distb", "disco",
"get_instructions", "Instruction", "Bytecode"] + _opcodes_all
del _opcodes_all
_have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
_have_code = (types.MethodType, types.FunctionType, types.CodeType,
classmethod, staticmethod, type)
def _try_compile(source, name):
"""Attempts to compile the given source, first as an expression and