E252 is being raised on what look to be valid annotated, expression-based arguments which contain equals.
Example:
# foo.py
def _default(name: str) -> float:
defaults = {'f': 100.0}
return defaults.get(name, 0.0)
def f(x, y: float = _default(name='f')) -> float:
"""Test function."""
return x + y
$ pycodestyle -v foo.py
user configuration: /Users/josh/.config/pycodestyle
checking foo.py
/tmp/foo.py:11:34: E252 missing whitespace around parameter equals
/tmp/foo.py:11:35: E252 missing whitespace around parameter equals
$ pycodestyle --version
2.4.0
$ cat ~/.config/pycodestyle
[pycodestyle]
max-line-length = 160
@taion
looks like commit: d9efb8f46220dc24f74cb8e0f963786d47deecdc missing something since it says:
Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when using a type annotation.
Definitely looks like my bug. Let me see.
Any chance of a release including a fix for this? I'm coming across this more and more. Thanks.
Yes please, a release!
Most helpful comment
Any chance of a release including a fix for this? I'm coming across this more and more. Thanks.