Skip to content

bpo-34524: Update comments for examples of format conversion#8964

Closed
rarevans wants to merge 1 commit into
python:masterfrom
rarevans:format_conversion_doc
Closed

bpo-34524: Update comments for examples of format conversion#8964
rarevans wants to merge 1 commit into
python:masterfrom
rarevans:format_conversion_doc

Conversation

@rarevans

@rarevans rarevans commented Aug 28, 2018

Copy link
Copy Markdown

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

@the-knights-who-say-ni

Copy link
Copy Markdown

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!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Aug 28, 2018
Comment thread Doc/library/string.rst
"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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rarevans rarevans closed this Aug 28, 2018
@rarevans rarevans deleted the format_conversion_doc branch November 2, 2018 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants