[Python-checkins] r63990 - peps/trunk/pep-0008.txt
guido.van.rossum
python-checkins at python.org
Fri Jun 6 20:48:49 CEST 2008
Author: guido.van.rossum
Date: Fri Jun 6 20:48:49 2008
New Revision: 63990
Log:
Clarify preferred way to break at a binary operator.
Modified:
peps/trunk/pep-0008.txt
Modified: peps/trunk/pep-0008.txt
==============================================================================
--- peps/trunk/pep-0008.txt (original)
+++ peps/trunk/pep-0008.txt Fri Jun 6 20:48:49 2008
@@ -87,7 +87,8 @@
continuation inside parentheses, brackets and braces. If necessary, you
can add an extra pair of parentheses around an expression, but sometimes
using a backslash looks better. Make sure to indent the continued line
- appropriately. Some examples:
+ appropriately. The preferred place to break around a binary operator is
+ *after* the operator, not before it. Some examples:
class Rectangle(Blob):
@@ -99,7 +100,8 @@
raise ValueError("sorry, you lose")
if width == 0 and height == 0 and (color == 'red' or
emphasis is None):
- raise ValueError("I don't think so")
+ raise ValueError("I don't think so -- values are %s, %s" %
+ (width, height))
Blob.__init__(self, width, height,
color, emphasis, highlight)
More information about the Python-checkins
mailing list