本文整理汇总了Python中mypy.errors.Errors.is_typeshed_file方法的典型用法代码示例。如果您正苦于以下问题:Python Errors.is_typeshed_file方法的具体用法?Python Errors.is_typeshed_file怎么用?Python Errors.is_typeshed_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mypy.errors.Errors
的用法示例。
在下文中一共展示了Errors.is_typeshed_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_type_arguments
# 需要导入模块: from mypy.errors import Errors [as 别名]
# 或者: from mypy.errors.Errors import is_typeshed_file [as 别名]
def check_type_arguments(graph: 'Graph', scc: List[str], errors: Errors) -> None:
for module in scc:
state = graph[module]
assert state.tree
analyzer = TypeArgumentAnalyzer(errors,
state.options,
errors.is_typeshed_file(state.path or ''))
with state.wrap_context():
with strict_optional_set(state.options.strict_optional):
state.tree.accept(analyzer)
示例2: check_type_arguments_in_targets
# 需要导入模块: from mypy.errors import Errors [as 别名]
# 或者: from mypy.errors.Errors import is_typeshed_file [as 别名]
def check_type_arguments_in_targets(targets: List[FineGrainedDeferredNode], state: 'State',
errors: Errors) -> None:
"""Check type arguments against type variable bounds and restrictions.
This mirrors the logic in check_type_arguments() except that we process only
some targets. This is used in fine grained incremental mode.
"""
analyzer = TypeArgumentAnalyzer(errors,
state.options,
errors.is_typeshed_file(state.path or ''))
with state.wrap_context():
with strict_optional_set(state.options.strict_optional):
for target in targets:
analyzer.recurse_into_functions = not isinstance(target.node, MypyFile)
target.node.accept(analyzer)