#977 Wrong code formatting with negative numbers

open
Editor (491)
5
2009-10-01
2009-10-01
No

Hi,

if you code-format an expression like
dict(a="b", b=-1)
you get
dict(a="b", b= -1)

(space before "-1") which is "wrong" according to PEP8:
"""
- Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value.

Yes:

def complex(real, imag=0.0):
return magic(r=real, i=imag)

No:

def complex(real, imag = 0.0):
return magic(r = real, i = imag)
"""

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks