-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Use f-strings in asyncio-task code examples #10035
Conversation
Replace str.format with f-strings in the code examples of asyncio-task documentation.
Does this make the code simpler? I would rather replace print('The coroutine raised an exception: {!r}'.format(exc)) with print('The coroutine raised an exception:', repr(exc)) |
1 similar comment
Does this make the code simpler? I would rather replace print('The coroutine raised an exception: {!r}'.format(exc)) with print('The coroutine raised an exception:', repr(exc)) |
I prefer f-strings. Other examples in the page are already using f-strings. (Since GitHub was having issues yesterday, I'm closing and re-opening this to re-trigger some of the CI) |
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.
Let's use f-strings for sake of uniformness.
GH-10083 is a backport of this pull request to the 3.7 branch. |
Replace str.format with f-strings in the code examples of asyncio-task documentation. (cherry picked from commit 9f43fbb) Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
IMHO the change makes the code easier to read (str.format => f-string). About f-string vs str % args... Well, that's a matter of taste. I'm not sure that there is a strong argument for one style or the other. I tend to prefer f-string. IMHO it's simpler to read. |
Mariatta was mentioned, but she's out of open source for the rest of September 2018, and parts of October 2018 . Be aware she might not get to this until November 2018. |
Replace str.format with f-strings in the code examples of asyncio-task documentation. (cherry picked from commit 9f43fbb) Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Replace str.format with f-strings in the code examples of asyncio-task documentation.