Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is docstring max line-length different to normal PEP8 standard?

So im looking at some code and bringing it up to PEP 8 standard with the help of pylint and i noticed that if i was using triple quotes for a print statement where the text went past 120 chars (we are allowing 120 instead of 79) pylint didn't complain.
Is this a bug in pylint or does it think it might be a comment and is more lenient with the length of lines or does it not care about how far over you go with strings in trippple quotes because you may want to format them that way?

For clarity: yes pylint works normally in every other case of going over the line length.

like image 325
Jacxel Avatar asked Apr 13 '12 15:04

Jacxel


2 Answers

Having used pylint regularly, I have also noticed this inconsistency. In the Maximum Line Length section of PEP8, it says:

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

I know that pylint does not at all enforce the 79 character or the 72 character line length limits for docstrings and comments, so I would guess that this is a pylint bug since it is non-compliant with PEP8 in this area.

like image 123
enderskill Avatar answered Oct 02 '22 14:10

enderskill


As pylint maintainer, I can tell this is definitly a bug.

@Jacxel : if you've trouble registering on logilab.org, you can still post the pb on the [email protected] mailing list

thanks

like image 43
sthenault Avatar answered Oct 02 '22 15:10

sthenault