PyDev, pep8.py conflict on spaces around negative numbers

W

Wanderer

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?
 
M

MRAB

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
 
W

Wanderer

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
 
W

Wanderer

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top