[SciPy-dev] Setting up your editor for NumPy/SciPy

Charles R Harris charlesr.harris at gmail.com
Mon Oct 29 01:46:31 EDT 2007


Hi Stefan,

On 10/3/07, Stefan van der Walt <stefan at sun.ac.za> wrote:
> Hi all,
>
> Since we are busy cleaning up the NumPy and SciPy sources, I'd like to
> draw your attention to the guidelines regarding whitespace.
>
> We use 4 spaces per indentation level, in Python and C code alike (see
> PEP 7: http://www.python.org/dev/peps/pep-0007/ under the heading
> Python 3000).  Lines should be a maximum of 79 characters long (to
> facilitate reading in text terminals), and must not have trailing
> whitespace.
>
> PEP 8 (http://www.python.org/dev/peps/pep-0008/) states:
>
>     """
>     The preferred way of wrapping long lines is by using Python's
>     implied line continuation inside parentheses, brackets and braces.
>     If necessary, you can add an extra pair of parentheses around an
>     expression, but sometimes using a backslash looks better.  Make
>     sure to indent the continued line appropriately.
>     """
>
> I attach a file, containing some common errors, which you can use to
> setup your editor.  I also attach the settings I use under Emacs to
> highlight the problems.
>

I've attached a perl program borrowed from the LKML that removes
trailing whitespace. Maybe we should put it on the scipy site
somewhere.

Chuck
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanfile
Type: application/octet-stream
Size: 1122 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20071028/181f2e85/attachment.obj>


More information about the SciPy-Dev mailing list