PyDev, pep8.py conflict on spaces around negative numbers

Wanderer wanderer at dialup4less.com
Mon Feb 11 13:56:29 EST 2013


On Monday, February 11, 2013 1:09:38 PM UTC-5, MRAB wrote:
> On 2013-02-11 16:39, Wanderer wrote:
> 
> > If I check the 'Use space before and after operators? (+, -, /, *,
> 
> > //, **, etc.)' in the Eclipse>PyDev>Editor>Code Style> Code
> 
> > Formatter, PyDev will insert a space before a negative number in a
> 
> > keyword parameter declaration. Pep8.py will then post a warning 'E251
> 
> > no spaces around keyword / parameter equals'.
> 
> >
> 
> > For example:
> 
> > foo(bar= -25)
> 
> >
> 
> > So which is right? Should there be a space before a negative number?
> 
> >
> 
> Pep8.py is right.
> 
> 
> 
> This is preferred:
> 
> 
> 
>      foo(bar=-25)
> 
> 
> 
> as is this:
> 
> 
> 
>      bar = -25

Then, I guess I'll uncheck the 'Use space before and after operators' in PyDev.

Thanks



More information about the Python-list mailing list