在 mypy 中键入查找或键入别名引用

问题描述 投票:0回答:0

我有一个函数如下:

def a():
  return b()

我想要的是:

def a() -> ReturnType[typeof b]:
  return b()

或...完全推断出返回类型的原始示例。

我搜索了 mypy 文档并查看了

typing
模块的内部。我不清楚这是否可行。让我知道!谢谢

mypy
© www.soinside.com 2019 - 2024. All rights reserved.