Commit Graph

144 Commits

Author SHA1 Message Date
Nick Coghlan 4b19deca98 Clarify PEP 8 point about preferring def statements 2014-08-08 21:07:46 +10:00
Barry Warsaw 58cc81fc33 Prefer "is not" over "not ... is". Closes 21540. 2014-05-20 18:14:17 -04:00
Nick Coghlan 65da967dc2 PEP 8: tweak some awkward wording pointed out in private email 2014-05-13 13:36:23 +10:00
Barry Warsaw 13e0bbf3fe Nice simplification from Nick. 2014-04-27 16:26:18 -04:00
Barry Warsaw 472d1422de Wording. 2014-04-27 13:37:04 -04:00
Barry Warsaw eea38be724 Additional clarifications based on discussion amongst the PEP authors. 2014-04-27 13:34:33 -04:00
Guido van Rossum 94af0e93e6 Make PEP 8 follow PEP 257 on docstring endings. 2014-03-02 09:29:33 -08:00
Brett Cannon f13f2d6ae5 Bring PEP 8 in line with PEP 257 2014-03-01 10:57:51 -05:00
Barry Warsaw b7879b52e9 Ethan Furman's latest patch for Issue 19331. 2013-11-01 12:56:37 -04:00
Guido van Rossum fa09420ca3 Merge 2013-08-02 08:13:25 -07:00
Nick Coghlan f7025e0fcc Another PEP 8 typo fix
Yay for not saving before committing :P
2013-08-02 20:46:19 +10:00
Nick Coghlan 5dbb9a10f1 Tweak source encoding wording 2013-08-02 20:28:35 +10:00
Nick Coghlan 05d72183a8 Fix typo 2013-08-02 20:20:17 +10:00
Nick Coghlan 7de08107a4 Use Guido's preferred wording re: line length 2013-08-02 20:18:45 +10:00
Nick Coghlan 1730f70421 Always defer to project specific guides 2013-08-02 12:30:37 +10:00
Nick Coghlan ad0edb7348 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
2013-08-02 12:26:24 +10:00
Guido van Rossum 5a0c59d25c Reduce desirability of using 100 chars per line. 2013-08-01 18:12:07 -07:00
Terry Jan Reedy 69ab45adcc PEP 8 spelling corrections 2013-08-01 17:32:07 -04:00
Nick Coghlan fade322fd5 Fix a typo 2013-08-01 23:34:34 +10:00
Nick Coghlan 7dba60ceea PEP 8 modernisation
Thanks to Guido van Rossum, Barry Warsaw, Raymond Hettinger,
Terry Reedy, Thomas Wouters and others for the constructive
feedback :)
2013-08-01 22:25:37 +10:00
Barry Warsaw 3a283f9827 Clarify the wording. 2013-07-09 09:27:16 -04:00
Barry Warsaw a87fddebef Relax PEP 8's perceived (but incorrect) prohibition against backslashed. 2013-07-03 13:26:36 -04:00
Barry Warsaw f1d4e5f985 As per BDFL pronouncement (via private email), be explicit that both styles of
closing brace/bracket/paren indentation shall be allowed.
2013-04-18 20:31:05 -04:00
Guido van Rossum 8c159aab40 Fix typo (an mix -> a mix). 2013-04-11 15:42:57 -07:00
Georg Brandl 6bf3a71f57 Closes #16950: update wording about raise syntax. 2013-01-13 11:28:10 +01:00
Georg Brandl c9c784550d Closes #16949: update wording about string exceptions. 2013-01-13 11:27:31 +01:00
Guido van Rossum 1a6a2e8f72 Switch broken examples for spaces around operators. Fixes issue 16239. 2012-10-27 19:04:41 -07:00
Ezio Melotti 7c098c5c15 #16325: remove outdated link and rephrase paragraph accordingly. 2012-10-28 00:33:29 +03:00
Raymond Hettinger 7cbdcfa301 Fix markup 2012-04-28 00:51:37 -07:00
Antoine Pitrou 36e5f61f80 Make context manager example likelier 2012-04-24 14:08:00 +02:00
Raymond Hettinger 660b6e478c Note that context manager should be in separate classes if they implement non-obvious behaviors. 2012-04-23 23:34:26 -07:00
Raymond Hettinger c0b1eb3d65 Restore the prohibition against using function annotations in the standard library.
At Guido's request, added notes regarding issues observed with various developer's
early attempts to use function annotations.
2012-04-22 21:32:34 -07:00
Barry Warsaw 5ca34439af Guido suggests alternative language for whitespace around operators. 2012-04-19 13:42:24 -04:00
Georg Brandl 0d61249dee Fix more markup. 2012-03-15 08:24:13 +01:00
Georg Brandl d8498d616a Fix markup. 2012-03-15 08:23:23 +01:00
Georg Brandl 3153cd2e37 Convert PEP 7 and PEP 8 to rst. 2012-03-15 08:18:38 +01:00
Guido van Rossum c606a1fdfe Delete rule forbidding function type annotations in the stdlib. 2012-03-02 10:18:31 -08:00
Barry Warsaw e12e762a54 PEP 8 updates on hanging continuation lines, based on discussion from
python-ideas (contributed by Steven Klass).
2011-06-13 12:48:33 -04:00
Guido van Rossum 848640dd6b Add rules for indenting continuation lines. 2011-06-02 11:09:20 -07:00
Raymond Hettinger bba94bd03d Add PEP 207 guidance on rich comparisons to PEP 8. 2011-04-06 13:53:31 -07:00
Michael Foord cf8828a7e3 Typo correction in pep 8 2011-02-17 23:12:04 +00:00
Raymond Hettinger bbc55dbeb2 Add note about how Control-L gets displayed. Fix whitespace. 2011-02-09 06:50:14 +00:00
Raymond Hettinger 56dcd4ff1e Issue #10899: Function annotations being kept out of the standard library. 2011-01-12 23:22:08 +00:00
Michael Foord 3b0897884e Modify the advice on line continuations to not recommend backslashes.
As discussed with Guido.
Also remove references to Python 2.0, 2.1 and 2.2
2010-11-28 19:45:15 +00:00
Georg Brandl 5e2069ee4c declarations are very rare in Python 2010-11-17 18:26:43 +00:00
Georg Brandl 7c4473de5c Even if utf-8 is the default for Python, it may not be for the editor. 2010-08-29 19:54:09 +00:00
Georg Brandl fe792444b7 Fix typo. 2009-01-22 08:36:39 +00:00
Benjamin Peterson 4cbb07b2a1 add a note about constant conventions 2009-01-22 03:33:57 +00:00
Guido van Rossum b4c0b18633 Clarify preferred way to break at a binary operator. 2008-06-06 18:48:49 +00:00
Skip Montanaro fe647edb10 Replace "looks ugly" with a hopefully more concrete explanation of why line
wrapping is bad - it disrupts the visual structure of the code.
2008-02-21 16:21:15 +00:00
Brett Cannon 9fe45a32c3 Make all meta-PEPs be Process PEPs. 2007-06-19 04:52:34 +00:00
Collin Winter 28930199da Convert two usages of StandardError into Exception. 2007-06-12 21:19:21 +00:00
Guido van Rossum 65d78ad8f2 Add policy about non-ASCII names to coding standard. 2007-05-17 16:48:09 +00:00
Andrew M. Kuchling 532382f5dc Fix 'the the' error 2007-04-28 00:36:48 +00:00
Guido van Rossum 38fbef2fb2 Add words discouraging overly-broad except clauses. 2007-04-06 15:09:21 +00:00
Andrew M. Kuchling a2a12a86ea Mention bare except: clauses in PEP 8; see the python-dev archive around Dec. 22 2007 for a short discussion 2007-02-01 21:09:28 +00:00
Andrew M. Kuchling 594770c5ec Wording fix 2007-02-01 21:04:19 +00:00
Andrew M. Kuchling 3be6bcdbc7 Be stricter about string exceptions 2007-02-01 21:03:07 +00:00
Barry Warsaw 4226413f7b Updated the rules for package names and module names, clarifying the use of
underscores.
2007-01-05 14:03:42 +00:00
David Goodger c5b5d3c83d added Last-Modified headers to all PEPs without 2006-03-23 20:13:19 +00:00
Guido van Rossum d9909922de Fix an inconsistency about whether 'cls' is preferred or not. 2006-03-23 18:56:43 +00:00
Guido van Rossum 8adb36ab81 Discourage relative imports. 2006-03-15 22:47:10 +00:00
Guido van Rossum 9feffcd8af /pubic/public/. Thanks Jennings Jared! 2006-03-02 03:46:55 +00:00
Barry Warsaw 9d3a63d38d Remove a bunch of Emacs references. They're unnecessary for making the point. 2005-12-15 15:44:35 +00:00
Barry Warsaw 1bd889d78c Fixed a couple of small tyops. 2005-12-14 22:54:57 +00:00
Guido van Rossum b7714412f7 Some additional tweakage, hopefully non-controversial. 2005-12-14 22:10:16 +00:00
Barry Warsaw 478d6d498e After lengthy discussion on python-dev, here is an update to the Python style
guide.  Hopefully it has been simplified and made more prescriptive, as well
as improved by all the great community suggestions.
2005-12-14 21:12:58 +00:00
David Goodger 7b245bb06d fixed raise syntax examples; closing http://python.org/sf/1264666 2005-08-20 13:48:50 +00:00
Andrew M. Kuchling ac8c835cce Record BDFL opinion on exception-raising style 2005-08-07 13:27:54 +00:00
Raymond Hettinger dec5ab7a7c SF patch #980695: efficient string concatenation
(Original patch by Armin Rigo).
2004-08-06 18:47:26 +00:00
Kurt B. Kaiser 9c67b23e5a Clarifications resulting from further discussion with Barry Warsaw. 2004-03-30 01:12:22 +00:00
Barry Warsaw e13d881fb8 updated a link 2004-03-27 20:37:02 +00:00
Barry Warsaw bae8037025 A few more minor updates for the Naming Conventions section:
- recommend that all new libraries use the standards, but point out that
  internal consistency with existing standards is more important.

- Use b and B instead of x and X (it's hard to distinguish the case of X in
  some fonts)

- StudlyCaps is another name for CapWords

- Re-order list so Function Names are followed by Method Names.  Also, added a
  few blank lines in the Method Names section, and described how underscores
  should separate words for readability.

- Added that double leading underscore is usually only necessary to resolve
  name conflicts in subclasses.
2004-03-27 20:14:19 +00:00
Kurt B. Kaiser fef61c2a39 Patch 919256
Clarify and standardize the format for names of modules, functions,
methods, and instance variables.

Consistent, I hope, with discussion on python-dev

http://mail.python.org/pipermail/python-dev/2004-March/043257.html

http://mail.python.org/pipermail/python-dev/2004-March/043259.html
2004-03-20 06:42:29 +00:00
Raymond Hettinger a37771e3cb * str.startwith() is less errorprone that slice comparisons but not as fast.
* Fix minor typos.
2003-09-27 02:53:59 +00:00
Barry Warsaw 99ab3d4e0c Setting my address back to barry@python.org for consistency and better
spam fighting defenses.
2003-09-22 04:51:50 +00:00
Barry Warsaw 8e4c8019b1 Added a note on compound statements after remarks from David Goodger.
Make the code samples agree with this recommendation. ;)
2002-10-17 15:32:18 +00:00
Guido van Rossum 36a82afee6 Add ruling about source code encodings. 2002-10-07 13:40:41 +00:00
Fred Drake d5b900cf13 Fix a couple of import statements. 2002-06-22 02:14:49 +00:00
Guido van Rossum 6655f152be Don't use 'strorunicodeobj' as the generic object name. Use just
'obj' -- after all, you don't know that it's a string or unicode
object just yet, that's what the test in these examples is for!
2002-06-04 17:02:07 +00:00
Neal Norwitz 22cf1a49f9 Update for all the various ways of checking for a string/unicode object
in 2.3, 2.2, 2.1/2.0.
2002-06-04 16:57:44 +00:00
Barry Warsaw 842de4b458 Slight change to the string methods recommendation; we mitigate the
recommendation if compatibility with pre-Python 2.0 is necessary.
2002-05-29 16:07:27 +00:00
Guido van Rossum 78c759d636 Two tiny clarifications. 2002-05-24 19:46:20 +00:00
Andrew M. Kuchling 74d28aabb3 Typo fix 2002-05-24 19:42:30 +00:00
Barry Warsaw a086f6d04f More additions based on comments from Tim Peters, Neal Norwitz,
Gerhard Haring, and Guido van Rossum.
2002-05-24 19:39:47 +00:00
Barry Warsaw 7c91cd266a Added Tim's names to avoid (with the addition of cap-I which looks
like an `l' in some fonts).
2002-05-24 17:07:17 +00:00
Barry Warsaw d5a7731ccf Integrated style recommendations from my (Barry's) mimelib/Mailman
style guide.  Only added recommendations that Guido agrees with. :)
2002-05-24 16:22:16 +00:00
Guido van Rossum 7112960b46 Minor nits. Add strong preference for spaces over tabs. 2002-05-24 15:01:43 +00:00
Barry Warsaw bd48c56a75 Roger <roger.haase@usa.net> points out that "mixed case" is
inconsistently used both to describe mixedCase and MixedCase.
MixedCase should really be CapWords, reserving mixedCase for the
situation where the first letter is lowercased.

Also, add a comment that MixedCase is sometimes called CamelCase.
Note that the existing most common case usage is that CamelCase has an
initial capitalized letter.

http://www.wikipedia.com/wiki/CamelCase
2001-12-21 05:49:26 +00:00
Guido van Rossum 5b12f72b7d Apply Strunk & White. (Paul Flowerman.) 2001-11-01 13:03:30 +00:00
Barry Warsaw 295e210393 barry@digicool.com => barry@zope.com 2001-08-14 15:45:26 +00:00
Guido van Rossum 8bee56c3bf Make the section on consistency a separate section, as in the
original.  Close an unmatched parenthesis at the very end.
2001-07-05 20:38:11 +00:00
Barry Warsaw e3eaa92bcf Post it today. 2001-07-05 18:56:34 +00:00
Barry Warsaw 80caa6827f Guido's famous Python Style Guide essay, converted to PEP format,
spellchecked and mildly edited.  It's still as incomplete as the
former.
2001-07-05 18:56:12 +00:00