每当发生类似情况时,Pylint 都会发出警告:
import typing
SEQ_FR = typing.TypeVar("SEQ_FR")
#^^^^^ gets underlined with the warning
Run Code Online (Sandbox Code Playgroud)
警告是这样的:Type variable name "SEQ_FR" doesn't conform to predefined naming style. pylint(invalid-name)
我尝试搜索 Pylint 的文档,但没有找到所使用的确切正则表达式/规范。与常规变量、方法、函数、类等不同,我似乎也无法将自定义正则表达式传递到 Pylint 上。
Pylint 使用什么规范将 TypeVar 变量标记为有效或无效名称?