`pyupgrade` is not idempotent: upgrading %-formatting to f-strings takes two passes.
See original GitHub issue$ echo '"%s, %r" % (x, y)' > example.py
$ pyupgrade --py36-plus example.py
Rewriting example.py
$ cat example.py
"{}, {!r}".format(x, y)
$ pyupgrade --py36-plus example.py
Rewriting example.py
$ cat example.py
f"{x}, {y!r}"
I think this is probably just a matter of pass ordering, and would be fixed if the percent-formatting fixer ran before the f-strings fixer?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
asottile/pyupgrade: A tool (and pre-commit hook) to ... - GitHub
GitHub - asottile/pyupgrade: A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
Read more >Release Notes — Airflow Documentation
To create a DAG that runs whenever a Dataset is updated use the new schedule parameter (see below) and pass a list of...
Read more >How to clean packages compatible Python 2.7 + 3 to make ...
I think a hypothetical internalization (which in many cases won't append) should not stop us from using f-strings, which are just cleaner (and ......
Read more >apache-airflow-backport-providers-google 2021.3.3 - PyPI
If your DAG uses an object from the above mentioned libraries passed by XCom, it is necessary to update the naming convention of...
Read more >fr2.rpmfind.net/linux/opensuse/ports/ppc/tumblewee...
#9562 #9567 ++++ icingaweb2: - Update to 2.11.2 It brings performance ... fix format sorting * Fix blur/contrast for X11 window if Xwayland...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
shed’s also in unsupported territory 😛
Ah, I hadn’t considered it a ‘substantial portion’ since it’s really just some regex patterns and the textwrap logic, both rewritten, and there are notes in the readme and code comments. If you have a suggested form of attribution I’d be very happy to add it though!