Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 性感的代码能通过pylint吗?_Python_Pylint_Voluptuous - Fatal编程技术网

Python 性感的代码能通过pylint吗?

Python 性感的代码能通过pylint吗?,python,pylint,voluptuous,Python,Pylint,Voluptuous,作为Python项目测试的一部分,我运行pylint-E,以确保错误不会蔓延到未经测试的代码中。一般来说,这种方法效果很好。但最近我遇到了和派林的问题 问题在于pylint认为由性感模式返回的值是列表,而事实并非如此。这里有一个玩具程序: import-volurous MyType=volupturous.Schema({ 问:str }) def foo(巴): bar=MyType(bar) q=bar.get('q') 打印q foo({'q':'1324'}) 它运行得很好: $ p

作为Python项目测试的一部分,我运行
pylint-E
,以确保错误不会蔓延到未经测试的代码中。一般来说,这种方法效果很好。但最近我遇到了和派林的问题

问题在于pylint认为由性感模式返回的值是列表,而事实并非如此。这里有一个玩具程序:

import-volurous
MyType=volupturous.Schema({
问:str
})
def foo(巴):
bar=MyType(bar)
q=bar.get('q')
打印q
foo({'q':'1324'})
它运行得很好:

$ python toy.py
1234
但是,pylint会标记
.get()
调用:

$ pylint -E toy.py
No config file found, using default configuration
************* Module toy
E: 11, 8: Instance of 'list' has no 'get' member (no-member)

如何使该程序通过
pylint-E

一个选项是完全忽略
volupluous
模块,例如

$ pylint -E --ignored-modules=voluptuous toy.py
(passes)

如果能更好地理解
pylint
就好了。

你可以明确地标记它-
#pylint:disable=no member
。我希望避免每次使用vollutuous时都必须标记它。