[Python-checkins] peps: Additional PEP 8 tweaks
nick.coghlan
python-checkins at python.org
Fri Aug 2 04:26:41 CEST 2013
http://hg.python.org/peps/rev/59e060c2ffe7
changeset: 5016:59e060c2ffe7
user: Nick Coghlan <ncoghlan at gmail.com>
date: Fri Aug 02 12:26:24 2013 +1000
summary:
Additional PEP 8 tweaks
- be explicit that project style guides take precedence
- make a line splitting example consistent with other guidelines
- clarify wording of the def-vs-lambda guideline
files:
pep-0008.txt | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/pep-0008.txt b/pep-0008.txt
--- a/pep-0008.txt
+++ b/pep-0008.txt
@@ -28,6 +28,10 @@
identified and past conventions are rendered obsolete by changes in
the language itself.
+Many projects incorporate this guide by reference into their own style
+guides. In the event of any conflicts, the project-specific style guide
+takes precedence.
+
A Foolish Consistency is the Hobgoblin of Little Minds
======================================================
@@ -201,8 +205,8 @@
def __init__(self, width, height,
color='black', emphasis=None, highlight=0):
if (width == 0 and height == 0 and
- color == 'red' and emphasis == 'strong' or
- highlight > 100):
+ color == 'red' and emphasis == 'strong' or
+ highlight > 100):
raise ValueError("sorry, you lose")
if width == 0 and height == 0 and (color == 'red' or
emphasis is None):
@@ -882,8 +886,8 @@
operator. However, it is best to implement all six operations so
that confusion doesn't arise in other contexts.
-- Always use a def statement instead of assigning a lambda expression
- to a name.
+- Always use a def statement instead of an assignment statement that binds
+ a lambda expression directly to a name.
Yes::
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list