__init__.py 文件源码

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

项目:sherlock.py 作者: Luavis 项目源码 文件源码
def get_function_return_type(self, function_name, args_type=[]):
        function = self.functions[function_name]
        if is_system_function(function_name):
            return SystemFunction.get_function(function_name).return_type
        if function is not None:
            if function.is_args_type_match(args_type):
                return function.return_type
            else:
                raise ParamTypeMismatchError("Function '%s' parameter type is not match", function_name)
        else:
            for node in self.module_node.body:
                if isinstance(node, ast.FunctionDef) and node.name == function_name:
                    generator, return_type = self.analysis_function(node, args_type)
                    self.functions.append(Function(function_name, args_type, return_type, generator))
                    return return_type
            return Type.STRING  # when function is not exist: string
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号