Message173770
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 + y*y
- c = (a+b) * (a-b)
+ x = x * 2-1
+ hypot2 = x*x + y * y
+ c = a+b * a-b
These 3 examples in the "No" section show respectively:
1) more space around the operator with higher priority;
2) inconsistent spacing around operators with the same priority;
3) misleading spacing (similar to 1);
I don't think it's necessary to mention 'x * 2 - 1' in either sections, because it's not wrong, but otoh 'x*2 - 1' is a better alternative. |
|
Date |
User |
Action |
Args |
2012-10-25 17:20:17 | ezio.melotti | set | recipients:
+ ezio.melotti, rhettinger, docs@python, pwuertz |
2012-10-25 17:20:17 | ezio.melotti | set | messageid: <1351185617.38.0.56111608403.issue16239@psf.upfronthosting.co.za> |
2012-10-25 17:20:17 | ezio.melotti | link | issue16239 messages |
2012-10-25 17:20:17 | ezio.melotti | create | |
|