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

Rewrite of '%s' % tuple changes behaviour #8

Open
asottile opened this issue Jul 6, 2019 · 0 comments
Open

Rewrite of '%s' % tuple changes behaviour #8

asottile opened this issue Jul 6, 2019 · 0 comments
Assignees

Comments

@asottile
Copy link

asottile commented Jul 6, 2019

(note this is a minimal case, the rule that pyupgrade uses is to avoid 1-ary formats with a single variable on the right hand side since it is not possible to know statically whether that is a format-of-tuple or a format-of-scalar)

before

x = (1,)
print('%s' % x)
$ python3 t.py
1

after

x = (1,)
print(f"{x}")
$ python3 t.py
(1,)

from the testsuite of pyupgrade

@jacktasia jacktasia self-assigned this Oct 18, 2019
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

2 participants