我想在未明确设置函数参数类型时显示警告。
正确:
def mul(a: float, b: float) -> float:
return a*b
不正确:
def mul(a: float, b) -> float:
return a*b
def mul(a: float, b: float):
return a*b
def mul(a, b):
return a*b
Python是否有可以检查此内容的库?像pylint
您可以将mypy与--disallow-incomplete-defs
一起使用。Link to docs