如何返回暗示已定义类型的类型

2024-05-15 01:03:01 发布

您现在位置:Python中文网/ 问答频道 /正文

如果我有以下情况:

def alert(self, text: str, color: str) -> str:

我能得到指定类型的参数吗

我尝试使用func.__code__.co_varnames&inspect.getargspec(func)没有很好的效果


Tags: textself类型参数def情况codealert

热门问题