-
Notifications
You must be signed in to change notification settings - Fork 369
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
pyupgrade: Modernize syntax for Python >= 3.7 #1080
Conversation
@@ -153,14 +153,14 @@ def inspect_member(node, name_prefix=''): | |||
anchorfile = node.find('anchorfile').text | |||
anchor = node.find('anchor').text | |||
|
|||
url = '%s/%s#%s' % (doxygen_base, anchorfile, anchor) | |||
url = '{}/{}#{}'.format(doxygen_base, anchorfile, anchor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be an f-string
|
||
doxygen[name] = {'url': url} | ||
|
||
if node.attrib['kind'] == 'function': | ||
ret_type = node.find('type').text | ||
arglist = node.find('arglist').text | ||
sig = '%s %s%s' % (ret_type, name, arglist) | ||
sig = '{} {}{}'.format(ret_type, name, arglist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be an f-string
I like:
The string formatting changes however are quite arbitrary and not even consistent. Sometimes f-string are used, sometimes not.. |
https://pypi.org/project/flynt will be more aggressive with f-string conversion while pyupgrade explains why it is intentionally timid https://github.com/asottile/pyupgrade#f-strings |
Should I run flynt also? |
I've cherry-picked the changes I'm comfortable with in #1202 |
pyupgrade --py37-plus **/*.py