On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossum <guido at python.org> wrote: > I don't believe PEP 8 requires whitespace around all binary operators. > Where do you read that? Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations (with elision): Use spaces around arithmetic operators: No: i=i+1 submitted +=1 x = x*2 - 1 hypot2 = x*x + y*y c = (a+b) * (a-b) End quote. In my code, whether Python or any other language, I tend to follow the principle that whitespace is completely optional in these expressions, but if spaces surround any operator, they should (generally) also surround all operators of lower precedence in the same expression. So I would quite happily accept all of the expressions above (except 'submitted', which is inconsistent), but would prefer not to see something like: c=(a + b)*(a - b) which is also forbidden by PEP 8. ChrisA
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4