hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.

Home Page:https://pypi.org/project/autopep8/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"for<space><space>" gets changed to "f<space>or<space>"

edgarcosta opened this issue · comments


Python Code

cm_opts = ([1] +
           [d for  d in [3,4]])

Command Line

$ autopep8 --diff --recursive --aggressive --select E27,W504 foo.py

--- original/foo.py
+++ fixed/foo.py
@@ -1,2 +1,2 @@
-cm_opts = ([1] +
-           [d for  d in [3,4]])
+cm_opts = ([1]
+           + [d f or d in [3,4]])

Your Environment

  • Python version: 3.11.2
  • autopep8 version: autopep8 2.0.2
  • pycodestyle: 2.10.0
  • Platform: linux and macOSX

I originally observed this here:
LMFDB/lmfdb@ae5ac12#diff-6d8d8530bb938c81789bbc90c06501eddf133bef2d233725681bbb999c2ce90dL1062-R1066