Skip to content
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

Improve readability of formataddr docstring #20963

Merged
merged 2 commits into from
Jun 19, 2020

Conversation

jugmac00
Copy link
Contributor

@jugmac00 jugmac00 commented Jun 18, 2020

For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified: Lib/email/utils.py

Automerge-Triggered-By: @csabella

modified:   Lib/email/utils.py
@@ -81,7 +81,7 @@ def formataddr(pair, charset='utf-8'):
If the first element of pair is false, then the second element is
returned unmodified.

Optional charset if given is the character set that is used to encode
Optional charset, if given, is the character set that is used to encode
Copy link
Contributor

@eamanu eamanu Jun 19, 2020

Choose a reason for hiding this comment

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

I agree to this change. IMHO for no natives is more natural read this, but I don't know if this change is normal for a native English speaker.

But, I think that we should remove the if given sentences, because, when the docstring say "Optional charset" that reference that charset could be given or not. Optional params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your reply. I am happy about any change which makes the docstring more readable.

And indeed, the sentence is much nicer without the if given clause.

I applied your suggestion with a follow up commit.

I noticed this if given pattern is used more often in this module. Should the other places also be updated?

This makes the docstring easier to comprehend.

modified:   Lib/email/utils.py
Copy link
Contributor

@csabella csabella left a comment

Choose a reason for hiding this comment

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

LGTM

@csabella
Copy link
Contributor

@jugmac00, thank you for the suggestion and @eamanu, thank you for the review. I agree that the if given phrase is redundant with optional.

@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: Base branch was modified. Review and try the merge again..

@miss-islington miss-islington merged commit 66a65ba into python:master Jun 19, 2020
@miss-islington
Copy link
Contributor

@jugmac00: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor

@jugmac00: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: Pull Request is not mergeable.

1 similar comment
@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: Pull Request is not mergeable.

@miss-islington
Copy link
Contributor

Thanks @jugmac00 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @jugmac00, I had trouble checking out the 3.9 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 66a65ba43cb3e68a43e32469c988dd7a6cff049c 3.9

@bedevere-bot
Copy link

GH-20977 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
(cherry picked from commit 66a65ba)

Co-authored-by: Jürgen Gmach <[email protected]>
@csabella csabella added needs backport to 3.9 only security fixes and removed needs backport to 3.9 only security fixes labels Jun 19, 2020
@miss-islington
Copy link
Contributor

Thanks @jugmac00 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-20978 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jun 19, 2020
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
(cherry picked from commit 66a65ba)

Co-authored-by: Jürgen Gmach <[email protected]>
miss-islington added a commit that referenced this pull request Jun 19, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
(cherry picked from commit 66a65ba)

Co-authored-by: Jürgen Gmach <[email protected]>
miss-islington added a commit that referenced this pull request Jun 19, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
(cherry picked from commit 66a65ba)

Co-authored-by: Jürgen Gmach <[email protected]>
fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants