Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

W293 unwarranted cargo culting #124

Closed
seanupton opened this Issue · 5 comments

4 participants

@seanupton

This is not meant to be cynical. PEP 8 takes no position on indenting whitespace on blanklines. IMHO, whitespace on blank lines SHOULD match the indentation level of the block they are within, and pasting into the Python interpreter seems to indicate that Python itself has this implied opinion. What is the history and context of pep8 (this tool) having the opposite opinion? What is the practical justification of consistently NOT having whitespace on blanklines matching indentation levels of surrouding blocks?

All enforcing this convention does is pit developers on teams against each other in passive-aggressive whitespace-change commit fests. And consistency with pep8's position is not as practical as consistent block indentation.

@myint

How would this result in a commit fest? If anything, I would think this forces all developers to follow a single standard.

@sigmavirus24

I'm with @myint on this issue.

@seanupton

The point is that this "standard" is not standard, but someone's arbitrarily made-up convention. And I'm saying "your style breaks tools." So pep8 (the tool, not PEP 8 the standard) breaks compatibility with the Python interactive interpreter. Don't break tools (ipyhon, built-in interactive interpreter)! We need conventions that are fully warranted, justified, and grounded in pragmatic practice. Half the Python world does "contextually meaningful whitespace" and the other half follows the "no whitespace on blanklines" conventions -- how is this increasing consistency? You folks are just saying "pick my standard" it is better... to which I respond, "justify it" -- and link: http://xkcd.com/927/

@seanupton

Apologies for snark. This is just one of those cases where the original cause/justification for this is lost in the lets-be-consistent debate, forgetting that we have a paradox leading to competing standards. A pessimistic take is that this needs some kind of fiat/declaration from a subsequent update to PEP 8 to actually take an opinion on meaningful whitespace. And I'm pretty sure that IDE/editor highlight modes could distinguish between meaningful and non-meaningful whitespace, as could pep8, as it already checks for other conditions regarding indent level of surrounding lines of code.

@florentx
Collaborator

Hello,

What was done in version 0.6 is split the warning W291 in two, and now W293 is raised for blank lines containing spaces.
This should be enough to give control to the user.
You can ignore W293 for one of your project (with --ignore W293 or in the configuration .pep8).

This rule is good enough for most developers, because these spaces are easily forgotten, and in a team there's always someone with an editor which removes trailing spaces on save.
Then it's an extra hassle to take care of this invisible signs.

@florentx florentx closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.