You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pycodestyle -v foo.py
checking foo.py
foo.py:2:10: E201 whitespace after '{'
foo.py:2:12: E251 unexpected spaces around keyword / parameter equals
foo.py:2:14: E202 whitespace before '}'
foo.py:2:14: E251 unexpected spaces around keyword / parameter equals
Those spaces should not be reported as problems. Spaces in front of x and around = in that string are significant. The = format was designed and implemented to allow such spaces. To quote from python/cpython#80998,
Finally, and this is the best part: what if you want whitespace around
the equals sign? Well, to the left is no problem; whitespace is preserved
from the original text inside the curly braces:
f"{ chr(65) =}" => " chr(65) ='A'"
But we also explicitly permit, and preserve, whitespace after the
equals sign:
f"{chr(65) = }" => "chr(65) = 'A'"
The text was updated successfully, but these errors were encountered:
With this file:
pycodestyle 2.12.1 gives this output:
Those spaces should not be reported as problems. Spaces in front of
x
and around=
in that string are significant. The=
format was designed and implemented to allow such spaces. To quote from python/cpython#80998,The text was updated successfully, but these errors were encountered: