Skip to content

Conversation

@ikamensh
Copy link

@ikamensh ikamensh commented Sep 28, 2020

I've used flynt to convert the source to use f-strings:

> flynt . -ll 110 

Execution time:                            1.278s
Files modified:                            19
Character count reduction:                 1400 (0.22%)

Per expression type:
No old style (`%`) expressions attempted.
`.format(...)` calls attempted:            169/170 (99.4%)
No concatenations attempted.
F-string expressions created:              158

Since unit tests only run for python 3.6+, I gathered this should be acceptable for the dependencies.

I've also done a manual change in a place where f-string wouldn't be created automatically:

"{0} is not a valid comparison operator: {0}".format(operator)
-> "{operator} is not a valid comparison operator."

@ikamensh
Copy link
Author

Hello hello - any opinions on this?

@ikonst
Copy link
Contributor

ikonst commented Nov 2, 2020

Maybe we should pre-commit along with pyupgrade to modernize this and other aspects of our codebase?

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

Successfully merging this pull request may close these issues.

2 participants