decompile.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:opyum 作者: Amper 项目源码 文件源码
def method_to_ast(method: types.MethodType, file: str = None) -> ast.FunctionDef:
    """
    Return node object for method.
    """

    if method and not isinstance(method, types.MethodType):
        raise TypeError('Unexpected type: {}'.format(str(type(method))))

    result = None

    if method and hasattr(method, '__code__'):
        result = code_to_ast(method.__code__, file)

    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号