Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion --no-recursive-string: Command option for don't convert format with a recursive string #203

Open
un-pogaz opened this issue Jan 28, 2025 · 0 comments

Comments

@un-pogaz
Copy link
Contributor

Even if Python support the use of string inside of a f-string value, for example retrive value of a dic, this syntax can be confusing and less readable than keep a normal format call.

So I suggest a command/option --no-recursive-string that will abort the conversion/optimization of the format call if the result will contain any recursive string.

With this option, the code

'name %s, type %s' % (file['id'], file['media-type'])

will be converted to:

f'name {}, type {}'.format(file['id'], file['media-type'])

and not:

f"name {file['id']}, type {file['media-type']}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant