bpo-34524: Update comments for examples of format conversion#8964
bpo-34524: Update comments for examples of format conversion#8964rarevans wants to merge 1 commit into
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
| "More {!a}" # Calls ascii() on the argument first | ||
| "Harold's a clever {0!s}" # Calls str() on the first argument | ||
| "Bring out the holy {name!r}" # Calls repr() on a named argument | ||
| "More {!a}" # Calls ascii() on an implicit argument |
There was a problem hiding this comment.
The examples say "on the argument first", because it's trying to say that !a, !s, and !r are conversions that are called first. That is, they're called before the resulting string is formatted.
I agree that the comments aren't great, but I think any changes need to make this point about conversions being applied first, and your edits lose that. Maybe something like "Calls str() on the argument before formatting the resulting string"? I realize it's a little long.
There was a problem hiding this comment.
Okay Eric, that is not how I read it when I encountered it. I can see what you mean about the original. This change is unnecessary then.
Updated the documentation section for format conversions. The example of conversion had comments that did not match the example. Small changes to wording for clarity.
https://bugs.python.org/issue34524
https://bugs.python.org/issue34524