1

I can disable the following warning completely:

W0141: Used builtin function %r Used when a black listed builtin function is used (see the bad-function option). Usual black listed functions are the ones like map, or filter , where Python offers now some cleaner alternative like list comprehension.

But is there also a way to remove one function from the black list?

4

2 回答 2

4

您可以为 pylint 生成一个 rc 文件。(请参阅pylint 文档如何执行此操作)

在其中你会发现这样的东西:

bad-functions=map,filter,apply,input

在那里,您可以简单地删除烦人的功能。如果您使用的是 Eclispe,请转到 PyLint 的首选项并在 pylint 输入框的参数中添加 --rcfile=path\to\your_rc_file 。

于 2013-09-19T10:59:39.523 回答
0

只需听听 Pylint 并使用更简洁的替代方法(例如列表理解)摆脱该黑名单功能的违规用法。

于 2013-09-19T11:03:14.787 回答