[Python-Dev] PEP 8 updates/clarifications

Ian Bicking ianb at colorstudy.com
Thu Dec 15 03:22:42 CET 2005


Barry Warsaw wrote:
> I've pushed out a revised PEP 8
> 
> http://www.python.org/peps/pep-0008.html

Just two little things...


     Use 4 spaces per indentation level.

     This is the default for Emacs's python-mode.  For really old code 
that you
     don't want to mess up, you can continue to use 8-space tabs.  Emacs
     python-mode auto-detects the prevailing indentation level used in a 
file
     and sets its indentation parameters accordingly.


I think the reference to Emacs here is unneeded.  "Use 4 spaces per 
indentation level" is sufficient instruction on its own.




     ...Latin-1 should only be
     used when a comment or docstring needs to mention an author name that
     requires Latin-1; otherwise, using \x escapes is the preferred way to
     include non-ASCII data in string literals.  An exception is made 
for those
     files that are part of the test suite for the code implementing PEP 
263.


I think the reference to PEP 263 tests is kind of obvious.



-- 
Ian Bicking  |  ianb at colorstudy.com  |  http://blog.ianbicking.org


More information about the Python-Dev mailing list