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 + 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.

----------
assignee: docs@python -> ezio.melotti
keywords: +patch
nosy: +ezio.melotti
stage:  -> patch review
Added file: http://bugs.python.org/file27713/issue16239.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16239>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to