当前位置: 首页>>代码示例>>Python>>正文


Python scoped_nodes.Module方法代码示例

本文整理汇总了Python中astroid.scoped_nodes.Module方法的典型用法代码示例。如果您正苦于以下问题:Python scoped_nodes.Module方法的具体用法?Python scoped_nodes.Module怎么用?Python scoped_nodes.Module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在astroid.scoped_nodes的用法示例。


在下文中一共展示了scoped_nodes.Module方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _object_type

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def _object_type(node, context=None):
    astroid_manager = manager.AstroidManager()
    builtins = astroid_manager.astroid_cache[BUILTINS]
    context = context or contextmod.InferenceContext()

    for inferred in node.infer(context=context):
        if isinstance(inferred, scoped_nodes.ClassDef):
            if inferred.newstyle:
                metaclass = inferred.metaclass()
                if metaclass:
                    yield metaclass
                    continue
            yield builtins.getattr('type')[0]
        elif isinstance(inferred, (scoped_nodes.Lambda, bases.UnboundMethod)):
            yield _function_type(inferred, builtins)
        elif isinstance(inferred, scoped_nodes.Module):
            yield _build_proxy_class('module', builtins)
        else:
            yield inferred._proxied 
开发者ID:AtomLinter,项目名称:linter-pylama,代码行数:21,代码来源:helpers.py

示例2: _object_type

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def _object_type(node, context=None):
    astroid_manager = manager.AstroidManager()
    builtins = astroid_manager.builtins_module
    context = context or contextmod.InferenceContext()

    for inferred in node.infer(context=context):
        if isinstance(inferred, scoped_nodes.ClassDef):
            if inferred.newstyle:
                metaclass = inferred.metaclass()
                if metaclass:
                    yield metaclass
                    continue
            yield builtins.getattr("type")[0]
        elif isinstance(inferred, (scoped_nodes.Lambda, bases.UnboundMethod)):
            yield _function_type(inferred, builtins)
        elif isinstance(inferred, scoped_nodes.Module):
            yield _build_proxy_class("module", builtins)
        else:
            yield inferred._proxied 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:21,代码来源:helpers.py

示例3: _object_type

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def _object_type(node, context=None):
    astroid_manager = manager.AstroidManager()
    builtins = astroid_manager.astroid_cache[BUILTINS]
    context = context or contextmod.InferenceContext()

    for inferred in node.infer(context=context):
        if isinstance(inferred, scoped_nodes.ClassDef):
            if inferred.newstyle:
                metaclass = inferred.metaclass()
                if metaclass:
                    yield metaclass
                    continue
            yield builtins.getattr("type")[0]
        elif isinstance(inferred, (scoped_nodes.Lambda, bases.UnboundMethod)):
            yield _function_type(inferred, builtins)
        elif isinstance(inferred, scoped_nodes.Module):
            yield _build_proxy_class("module", builtins)
        else:
            yield inferred._proxied 
开发者ID:luckystarufo,项目名称:pySINDy,代码行数:21,代码来源:helpers.py

示例4: leave_module

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def leave_module(self, node):
        # type: (scoped_nodes.Module) -> None
        """
        We perform the actual check just before we leave the module since that's when the file has
        been fully processed.
        """
        node_file_path = self._get_file_path_for_node(node=node)

        third_party_nodes = list(
            self._third_party_import_nodes.get(node_file_path, [])
        )  # type: List[node_classes.Import]
        scalyr_init_node = self._scalyr_init_nodes.get(node_file_path, None)

        for import_node in third_party_nodes:
            self._verify_import_node_comes_after_scalyr_init(
                scalyr_init_node=scalyr_init_node, import_node=import_node
            ) 
开发者ID:scalyr,项目名称:scalyr-agent-2,代码行数:19,代码来源:bundled_imports_checker.py

示例5: visit_module

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def visit_module(self, node):
        # type: (scoped_nodes.Module) -> None
        self.__current_module = node.name 
开发者ID:scalyr,项目名称:scalyr-agent-2,代码行数:5,代码来源:py2exe_checker.py

示例6: leave_module

# 需要导入模块: from astroid import scoped_nodes [as 别名]
# 或者: from astroid.scoped_nodes import Module [as 别名]
def leave_module(self, _node):
        # type: (scoped_nodes.Module) -> None
        self.__current_module = None 
开发者ID:scalyr,项目名称:scalyr-agent-2,代码行数:5,代码来源:py2exe_checker.py


注:本文中的astroid.scoped_nodes.Module方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。