Is docstring max string length different from regular PEP8 standard?

So, I look at some code and bring it to the PEP 8 standard using pylint, and I noticed that if I used triple quotes for the print statement, where the text passed 120 characters (we allow 120 instead of 79) complained.
Is this a mistake in pylint, or does it think it is a comment and is more lenient with the length of the lines, or does it not care how far the lines go in trippple quotes, because you can format them that way?

For clarity: yes pylint works fine in every other case of passing the length of a string.

+6
source share
2 answers

Using pylint regularly, I also noticed this inconsistency. The Maximum Line Length section in PEP8 says:

Therefore, please limit all lines to a maximum of 79 characters. For streams of long blocks of text ( docstrings or comments ), it is recommended to limit the length to 72 characters.

I know that pylint does not apply the character length limit of 79 characters or 72 characters for dockers and comments at all, so I would suggest that this is a pylint error because it does not match PEP8 in this area.

+4
source

As a supporting pylint, I can say that this is definitely a mistake.

@Jacxel: if you have problems logging in to logilab.org, you can still post pb to the mailing list python-projects@logilab.org

thanks

+2
source

Source: https://habr.com/ru/post/913139/


All Articles