[Python-checkins] r69777 - in python/trunk/Doc:howto/doanddont.rst howto/webservers.rstincludes/sqlite3/adapter_datetime.py library/asyncore.rstlibrary/cgi.rst library/configparser.rstlibrary/cookielib.rst library/crypt.rst library/csv.rst li

Georg Brandl g.brandl at gmx.net
Fri Feb 20 19:27:36 CET 2009


Amen!

Georg

Guido van Rossum schrieb:
> PEP 8 was not designed with examples in mind. While many of its
> recommendations make sense in all contexts (like the horizontal
> spacing rules), the requirements for docstrings or comments, for
> example, don't make sense in examples, and in examples it is much more
> defensible to use short variable names. An example typical comes in a
> context that explains what it is about so the reader doesn't have to
> guess so much. Imports, in examples, are usually just a distraction
> from the action, so compacting them (or omitting them when they are
> obvious, perhaps from previous examples) makes sense.
> 
> On Fri, Feb 20, 2009 at 1:18 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> Georg Brandl wrote:
>>> I had the feeling that following PEP 8 in our examples would be good; but I
>>> can see that brevity is also a virtue here.
>>
>> Of the various guidelines in PEP 8, that's the one I probably break most
>> often in production code. Non-as imports of commonly used standard
>> library modules can create a lot of clutter if you follow it all the
>> time (especially for short module names like os, sys, time, re, etc).
>>
>> The PEP guideline is still a good default rule though - it's just a
>> judgment call as to when the increased use of vertical screen real
>> estate from following it becomes excessive.
> 


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list