找到你要的答案

Q:Pylint missclick string.strEp (string.strip) not detected

Q:Pylint missclick string.strEp(字符串。带)没有检测到

How can I config Pylint to detect this missclick?

str="dsdsdsdsds"
str1=str.splEt("d")

instead of

str1=str.split("d")

My config file:

[REPORTS]

reports=no

[MESSAGES CONTROL]

disable=W,R,C 

我如何配置pylint检测这missclick?

str="dsdsdsdsds"
str1=str.splEt("d")

而不是

str1=str.split("d")

我的配置文件:

[REPORTS]

reports=no

[MESSAGES CONTROL]

disable=W,R,C 
answer1: 回答1:

You mean getting a no-member error, because the attribute is missing? It already emits this, maybe you are disabling the error somewhere in pylintrc.

No config file found, using default configuration
************* Module a
C:  1, 0: Final newline missing (missing-final-newline)
C:  1, 0: Exactly one space required around assignment
str1=str.splEt("d")    ^ (bad-whitespace)
C:  1, 0: Missing module docstring (missing-docstring)
C:  1, 0: Invalid constant name "str1" (invalid-name)
E:  1, 9: Class 'str' has no 'splEt' member (no-member)

您的意思是获得一个成员错误,因为属性丢失?它已经发出,可能是你禁用错误在pylintrc。

No config file found, using default configuration
************* Module a
C:  1, 0: Final newline missing (missing-final-newline)
C:  1, 0: Exactly one space required around assignment
str1=str.splEt("d")    ^ (bad-whitespace)
C:  1, 0: Missing module docstring (missing-docstring)
C:  1, 0: Invalid constant name "str1" (invalid-name)
E:  1, 9: Class 'str' has no 'splEt' member (no-member)
answer2: 回答2:

i found the solution in pylintrc

[LOGGING]

logging-modules=logging

我在pylintrc找到解决办法

[LOGGING]

logging-modules=logging
python  string  pylint