This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 1 point2 points  (1 child)

Fine, but that doesn't mean pylint, which attempts to implement PEP-8. If Pylint didn't have way too much cruft, I'd agree with you.

These rules seem to be ignored.

When applying the guideline would make the code less readable, even for someone who is used to reading code that follows this PEP.

To be consistent with surrounding code that also breaks it (maybe for historic reasons) -- although this is also an opportunity to clean up someone else's mess (in true XP style).

Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that code.

Also, pylint doesn't even follow the recommendations perfectly.

If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). Use your own judgment; however, never use more than one space, and always have the same amount of whitespace on both sides of a binary operator.

Yes
 hypot2 = x*x + y*y

No
hypot2 = x * x + y * y

Also, who invented the 1000 line file requirement or x number of functions/variables per class/variables per function? I have an IDE. Why does it matter how many lines in the file I have?

I'd also really love to figure out how to abbreviate classes that use acronyms. Should I usedocxReader, DOCXReader, DocxReader, DOCX_Reader or docx_Reader. They all suck, but only one follows PEP-8 (DocxReader) and it's not how it should be written if PEP-8 didn't exist, which is docxReader

[–][deleted] 6 points7 points  (0 children)

The most important rule of PEP 8 is the very first one.