[Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

Barry Warsaw barry at python.org
Thu Feb 21 18:15:00 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Feb 21, 2008, at 11:21 AM, skip.montanaro wrote:

> Author: skip.montanaro
> Date: Thu Feb 21 17:21:15 2008
> New Revision: 60919
>
> Modified:
>   peps/trunk/pep-0008.txt
> Log:
> Replace "looks ugly" with a hopefully more concrete explanation of  
> why line
> wrapping is bad - it disrupts the visual structure of the code.
>
>
> Modified: peps/trunk/pep-0008.txt
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- peps/trunk/pep-0008.txt	(original)
> +++ peps/trunk/pep-0008.txt	Thu Feb 21 17:21:15 2008
> @@ -77,10 +77,11 @@
>
>     There are still many devices around that are limited to 80  
> character
>     lines; plus, limiting windows to 80 characters makes it possible  
> to have
> -    several windows side-by-side.  The default wrapping on such  
> devices looks
> -    ugly.  Therefore, please limit all lines to a maximum of 79  
> characters.
> -    For flowing long blocks of text (docstrings or comments),  
> limiting the
> -    length to 72 characters is recommended.
> +    several windows side-by-side.  The default wrapping on such  
> devices
> +    disrupts the visual structure of the code, making it more  
> difficult to
> +    understand.  Therefore, please limit all lines to a maximum of 79
> +    characters.  For flowing long blocks of text (docstrings or  
> comments),
> +    limiting the length to 72 characters is recommended.

Why should docstrings and comments be limited to 72 characters when  
code is limited to 79 characters?  I ask because there is an ongoing  
debate at my company about this.

Personally, I see no justification for it, and further, it's a pita to  
support automatically because tools like Emacs only have one auto- 
wrapping variable (fill-column).  Emacs doesn't know that it should  
fill comments and docstrings different than code lines, so you have to  
do a bunch of manual crud to support these guidelines.

I recommend removing the guideline of 72 characters, and just say  
everything, code, comments, and docstrings should be no wider than 79  
characters.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iQCVAwUBR72xlXEjvBPtnXfVAQKEdAP/f1xnvn6jw04yyhSZfqA6HdgnYnpnYPAl
S4ixszL8phg6KRq8CD2ceskY8TocDg+GG6c//M+jihRRzXMXHW/1Lfp/6syqAd1d
vkWaUffaSK4rReMiEG0EmFZmYwaJA660RU0YBnv1d1Idpexj4Y/kIgfgou9OkWDY
iJO+efk93Xc=
=qYfT
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list