Does F-string float formatting really violate PEP 8

145 views Asked by At

a=3.1415

print(f"[{a:.2f}]")

produces

[3.14]

that's OK, but PyCharm says: PEP 8: E231 missing whitespace after ':'

fixed version

print(f"[{a: .2f}]")

produces

[ 3.14]

which has extra space before the number.

Who's to blame: Python, Pycharm or me :-)

0

There are 0 answers