pan*_*esh 6 python types type-hinting mypy
variable=[]
错误:
error: Need type annotation for 'variable' (hint: "variable: List[<type>] = ...")
Run Code Online (Sandbox Code Playgroud)
在配置文件中:mypy.ini
disallow_any_expr=False
有没有办法通过配置文件中的标志来覆盖此错误?
你可以试试这个:
mypy --show-error-code your_module.py,它将输出方括号内的错误代码mypy.ini,添加disable_error_code = code