本文整理汇总了Python中mypy.nodes.FuncDef.expanded方法的典型用法代码示例。如果您正苦于以下问题:Python FuncDef.expanded方法的具体用法?Python FuncDef.expanded怎么用?Python FuncDef.expanded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mypy.nodes.FuncDef
的用法示例。
在下文中一共展示了FuncDef.expanded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: visit_func_def
# 需要导入模块: from mypy.nodes import FuncDef [as 别名]
# 或者: from mypy.nodes.FuncDef import expanded [as 别名]
def visit_func_def(self, node: FuncDef) -> None:
if not self.recurse_into_functions:
return
node.expanded = []
node.type = node.unanalyzed_type
with self.enter_method(node.info) if node.info else nothing():
super().visit_func_def(node)
示例2: visit_func_def
# 需要导入模块: from mypy.nodes import FuncDef [as 别名]
# 或者: from mypy.nodes.FuncDef import expanded [as 别名]
def visit_func_def(self, node: FuncDef) -> None:
if not self.recurse_into_functions:
return
node.expanded = []
node.type = node.unanalyzed_type
# Type variable binder binds tvars before the type is analyzed.
# It should be refactored, before that we just undo this change here.
# TODO: this will be not necessary when #4814 is fixed.
if node.type:
assert isinstance(node.type, CallableType)
node.type.variables = []
with self.enter_method(node.info) if node.info else nothing():
super().visit_func_def(node)