本文整理汇总了Python中mypy.nodes.FuncDef.fullname方法的典型用法代码示例。如果您正苦于以下问题:Python FuncDef.fullname方法的具体用法?Python FuncDef.fullname怎么用?Python FuncDef.fullname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mypy.nodes.FuncDef
的用法示例。
在下文中一共展示了FuncDef.fullname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_callsites
# 需要导入模块: from mypy.nodes import FuncDef [as 别名]
# 或者: from mypy.nodes.FuncDef import fullname [as 别名]
def get_callsites(self, func: FuncDef) -> Tuple[List[Callsite], List[str]]:
"""Find all call sites of a function."""
new_type = self.get_trivial_type(func)
collector_plugin = SuggestionPlugin(func.fullname())
self.plugin._plugins.insert(0, collector_plugin)
try:
errors = self.try_type(func, new_type)
finally:
self.plugin._plugins.pop(0)
return collector_plugin.mystery_hits, errors
示例2: try_type
# 需要导入模块: from mypy.nodes import FuncDef [as 别名]
# 或者: from mypy.nodes.FuncDef import fullname [as 别名]
def try_type(self, func: FuncDef, typ: Type) -> List[str]:
"""Recheck a function while assuming it has type typ.
Return all error messages.
"""
old = func.unanalyzed_type
# During reprocessing, unanalyzed_type gets copied to type (by aststrip).
# We don't modify type because it isn't necessary and it
# would mess up the snapshotting.
func.unanalyzed_type = typ
try:
res = self.fgmanager.trigger(func.fullname())
# if res:
# print('\n'.join(res))
return res
finally:
func.unanalyzed_type = old