PyDev, pep8.py conflict on spaces around negative numbers

Discussion in 'Python' started by Wanderer, Feb 11, 2013.

  1. Wanderer

    Wanderer Guest

    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?
    Wanderer, Feb 11, 2013
    #1
    1. Advertising

  2. Wanderer

    MRAB Guest

    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
    MRAB, Feb 11, 2013
    #2
    1. Advertising

  3. Wanderer

    Wanderer Guest

    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, Feb 11, 2013
    #3
  4. Wanderer

    Wanderer Guest

    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, Feb 11, 2013
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. prem_eda
    Replies:
    5
    Views:
    7,825
    Pieter Hulshoff
    Oct 11, 2004
  2. John B. Matthews
    Replies:
    4
    Views:
    655
    John B. Matthews
    Sep 12, 2008
  3. Roedy Green
    Replies:
    3
    Views:
    613
  4. charles cashion

    css conflict (or html conflict)

    charles cashion, Feb 18, 2009, in forum: HTML
    Replies:
    2
    Views:
    778
    charles cashion
    Feb 18, 2009
  5. Ali Zandi

    How to make PyDev pep8 friendly?

    Ali Zandi, Feb 9, 2012, in forum: Python
    Replies:
    1
    Views:
    651
    Fabio Zadrozny
    Feb 17, 2012
Loading...

Share This Page