mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #26733: Disassembling a class now disassembles class and static methods.
Patch by Xiang Zhang.
This commit is contained in:
commit
8b9eefc363
4 changed files with 60 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue