This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Argparse: Refactor '%' interpolation to f-strings
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, rhettinger, serhiy.storchaka, shivnaren
Priority: normal Keywords:

Created on 2021-10-16 18:42 by shivnaren, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg404108 - (view) Author: Shivnaren Srinivasan (shivnaren) * Date: 2021-10-16 18:42
I use `argparse` a lot, and I think it's great—going through the source code, I see all string interpolation is with the old printf `%` formatting.

AFAIK, f-strings are now the suggested method for interpolation (*after they were introduced, that is*).

Do we want to refactor the '%' instances to f-strings? Happy to submit a PR if so.
msg404113 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-16 20:46
Pure cosmetic changes are usually rejected.
msg404114 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2021-10-16 20:49
As a rule, we don’t accept such wholesale changes. If there’s a performance problem, or a bug, then we’d look at individual cases.
msg404116 - (view) Author: Shivnaren Srinivasan (shivnaren) * Date: 2021-10-16 21:33
Understood--thank you for the responses.
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89660
2021-10-16 21:33:33shivnarensetstatus: open -> closed
resolution: rejected
messages: + msg404116

stage: resolved
2021-10-16 20:49:25eric.smithsetnosy: + eric.smith
messages: + msg404114
2021-10-16 20:46:11serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg404113
2021-10-16 18:42:33shivnarencreate