Fix for issue #96 - optional whitespace around operators #123

merged 2 commits into from Dec 19, 2012


None yet

2 participants


This pull request gives a possible solution to issue #96.

The current behaviour is to trigger E225 when there is no whitespace around any binary operator. This patch relaxes the condition in line with recent to revisions to pep-8. High precedence mathematical operators (, *, /, //) are handled in a whitespace optional manner. This means statements like 2*30, (x + y)(x - y) are now valid and no longer trigger E225.

Given the flexibility built into the new definition of pep8, we could further relax the check to allow statements like (x+y) to be valid, but in my experience this would not be a good move.

I think this patch strikes the right balance between allowing common conventions while preventing vasts blocks of run on code with no distinguishing whitespace.

@florentx florentx merged commit a6085df into PyCQA:master Dec 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment