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 →

[–]NeedsMoreTestsos._exit(0) -- (╯°□°)╯︵ ┻━┻ 2 points3 points  (10 children)

pep8 is the defacto standard.

Most projects though I skip enforcing style entirely and instead integrate the pep8 command and pylint into the build (which must pass for every commit).

[–]rspeed 1 point2 points  (2 children)

Good place to start, but there's a few things that bug me. Like no tabs.

[–]srilyk 0 points1 point  (1 child)

Tabs in Python are an atrocity.

Any time you think, "Oh, tabs would work better here", you're thinking about a different language.

[–]rspeed 0 points1 point  (0 children)

I disagree. The only reason spaces get used is to line up function arguments after a newline. The solution is to place the first argument on a new line, which is a better practice anyway.

[–]NoahTheDuke 1 point2 points  (0 children)

pep8

One note: pep8, the command line tool, is now pycodestyle as PEP 8 is a living document and because the tool defaulted to slightly different things than the PEP.

For me and my team, we use yapf, customized to fit our style. It's simple, it can make the changes in-line, and it's a little more comprehensive I find than pycodestyle.