Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   PyDev, pep8.py conflict on spaces around negative numbers (http://www.velocityreviews.com/forums/t957521-pydev-pep8-py-conflict-on-spaces-around-negative-numbers.html)

Wanderer 02-11-2013 04:39 PM

PyDev, pep8.py conflict on spaces around negative numbers
 
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 / parameterequals'.

For example:
foo(bar= -25)

So which is right? Should there be a space before a negative number?

MRAB 02-11-2013 06:09 PM

Re: PyDev, pep8.py conflict on spaces around negative numbers
 
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

Wanderer 02-11-2013 06:56 PM

Re: PyDev, pep8.py conflict on spaces around negative numbers
 
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

Wanderer 02-11-2013 06:56 PM

Re: PyDev, pep8.py conflict on spaces around negative numbers
 
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


All times are GMT. The time now is 07:44 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.