使用Python2 / 3 compatibility导入时,例如
from builtins import bytes
pylint发出警告:
重新定义内置'
bytes
' (重新定义-内建)
如何为builtins
模块抑制它们?
答案 0 :(得分:1)
自pylint 1.6以来,有一个新选项--redefining-builtins-modules
。将builtins
添加到其默认值six.moves,future.builtins
可解决问题:
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,future.builtins,builtins