[issue16239] PEP8 arithmetic operator examples

2012-10-28 Thread Guido van Rossum
Guido van Rossum added the comment: That example doesn't feel strong enough to me to include in the style guide. I am fine with leaving that up to the individual contributor to decide. -- ___ Python tracker __

[issue16239] PEP8 arithmetic operator examples

2012-10-28 Thread Éric Araujo
Éric Araujo added the comment: One idiom is not covered by the examples: value = seq[something+1] IMO it feels weird to put spaces in an index/slice notation. -- nosy: +eric.araujo ___ Python tracker _

[issue16239] PEP8 arithmetic operator examples

2012-10-28 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks! FTR, this is the changeset: http://hg.python.org/peps/rev/16dd63848921 -- stage: patch review -> committed/rejected ___ Python tracker __

[issue16239] PEP8 arithmetic operator examples

2012-10-27 Thread Guido van Rossum
Guido van Rossum added the comment: Corrected to: Yes:: i = i + 1 submitted += 1 x = x*2 - 1 hypot2 = x*x + y*y c = (a+b) * (a-b) No:: i=i+1 submitted +=1 x = x * 2 - 1 hypot2 = x * x + y * y c = (a + b) * (a - b) -- res

[issue16239] PEP8 arithmetic operator examples

2012-10-27 Thread Guido van Rossum
Changes by Guido van Rossum : -- assignee: ezio.melotti -> gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue16239] PEP8 arithmetic operator examples

2012-10-27 Thread Guido van Rossum
Guido van Rossum added the comment: Wow. Someone edited that to be completely against my guidance. I'll fix it according to my intentions. -- ___ Python tracker ___ __

[issue16239] PEP8 arithmetic operator examples

2012-10-27 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16239] PEP8 arithmetic operator examples

2012-10-26 Thread Peter Würtz
Peter Würtz added the comment: >> x * 2 - 1 is less clear than x*2 - 1 > I don't feel this. Anyone else feel this? I strongly feel so. And if you don't take my word for it, just open any math book or look at any formula and recognize that it is the general consensus that the elements of a pr

[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti
Ezio Melotti added the comment: As I see it: For c = (a + b) * (a - b) the hint (and the actual priority) is given by the (), the spaces around the +/- are not necessary but don't affect readability. For c = (a+b) * (a-b) the hints are given both by the () and the spacing, the lack of space

[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > As I explained in my previous message, even if valid, these are IMHO less > clear than x*2 - 1 and x*x + y*y. I don't feel this. Anyone else feel this? It seems to me, this is a serious change in the Style Guide. > It does indeed, but I think it's worth

[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti
Ezio Melotti added the comment: > >- x = x * 2 - 1 > >- hypot2 = x * x + y * y > > Why you remove this? As I explained in my previous message, even if valid, these are IMHO less clear than x*2 - 1 and x*x + y*y. > >- c = (a+b) * (a-b) > >+ c = a+b * a-b > > This changes the

[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >- x = x * 2 - 1 >- hypot2 = x * x + y * y Why you remove this? >- c = (a+b) * (a-b) >+ c = a+b * a-b This changes the semantic. >but otoh 'x*2 - 1' is a better alternative. Can you justify this? -- nosy: +serhiy.storchaka ___

[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti
Ezio Melotti added the comment: Attached a patch that modifies some of the example in the section. - x = x * 2 - 1 - hypot2 = x * x + y * y + x = x*2 - 1 + hypot2 = x*x + y*y Here I used more space around operators with lower priority. - x = x*2 - 1 - hypot2 = x*x

[issue16239] PEP8 arithmetic operator examples

2012-10-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Shouldn't this be in the "Yes" > or an "Optionally" example block? +1 -- nosy: +rhettinger ___ Python tracker ___ __

[issue16239] PEP8 arithmetic operator examples

2012-10-15 Thread Peter Würtz
New submission from Peter Würtz: I think the PEP8 examples for arithmetic expressions are a bit misleading. (http://www.python.org/dev/peps/pep-0008/#id20) The text clearly says that it should add spaces around operators of low(est) priority, which means that I'm encouraged to visually group a