繁体   English   中英

是否有 python linter 检查类型提示是否来自输入模块?

[英]Is there a python linter that checks if the type hint comes from the typing module?

我正在寻找一个 python linter 来检查类型提示是否来自输入模块。

就像这样:

def  func(arg: list)-> None:
   """ does something """

应该:

from typing import List

def  func(arg: List)-> None:
   """ does something """

要回答,您可以使用mypy 关于typing.List3.9起已弃用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM