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
Certain strings, wrapped with a continuation character, are getting changed with autopep8, even though pycodestyle has no issue with them, and they are PEP8 compliant.
In the code below, autopep8 wants to realign my_str. Notably:
This issue was NOT seen with autopep8 2.3.1 running in Python 3.10.14. It DOES show up with autopep8 2.3.1 and Python 3.12.4.
This issue does not show up if the f-string is not used.
This issue does not show up if the string is at the module level (not indented).
Python Code
defmy_fn():
"""Do the thing."""foo="foo"my_str=f"lorem ipsum lorem ipsum lorem ipsum {foo}" \
"lorem ipsum lorem ipsum lorem ipsum"print(my_str)
Command Line
$ pyenv local 3.12.4
$ autopep8 --diff temp.py --- original/temp.py+++ fixed/temp.py@@ -5,6 +5,6 @@ foo = "foo" my_str = f"lorem ipsum lorem ipsum lorem ipsum {foo}" \- "lorem ipsum lorem ipsum lorem ipsum"+ "lorem ipsum lorem ipsum lorem ipsum" print(my_str)
$ pycodestyle temp.py
$ pip list | grep autopep8autopep8 2.3.1
$ pyenv local 3.10.14
$ autopep8 --diff temp.py
$
$ pip list | grep autopep8autopep8 2.3.1
Your Environment
Python version: 3.12.4
autopep8 version: 2.3.1
Platform: Linux (Ubuntu 24.04)
The text was updated successfully, but these errors were encountered:
Certain strings, wrapped with a continuation character, are getting changed with autopep8, even though pycodestyle has no issue with them, and they are PEP8 compliant.
In the code below, autopep8 wants to realign
my_str
. Notably:Python Code
Command Line
Your Environment
The text was updated successfully, but these errors were encountered: