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

bpo-46732: fix __bool__ docstring #31301

Merged
merged 1 commit into from Feb 21, 2022
Merged

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Feb 12, 2022

Copy link
Member

@sweeneyde sweeneyde left a comment

Choose a reason for hiding this comment

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

I have no preference between Return True if self else False versus Return bool(self), but either way this is a clear improvement over the existing docstring, so it LGTM.

@merwok
Copy link
Member

merwok commented Feb 17, 2022

I have no preference between Return True if self else False versus Return bool(self)

I think these docstrings (like abs(self)) mean implements abs(self), not the redundant returns abs(self).

After discussing counter-proposals, I’m +1 too for the True if self else False proposal. if self is the important part, and can be glossed by teachers or mentors to explain what boolean contexts are.

@JelleZijlstra JelleZijlstra self-assigned this Feb 17, 2022
@JelleZijlstra
Copy link
Member Author

Thanks @merwok! Planning to merge this in a few days since there are multiple approvals and the change is low-risk (cc @gvanrossum).

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

I read the discussion and I agree that this is the best wording.

@JelleZijlstra JelleZijlstra added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Feb 17, 2022
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

See comment

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@JelleZijlstra
Copy link
Member Author

I have made the requested changes; please review again

Well, not exactly, but the requested changes would be either incorrect or inconsistent with other similar docstrings. I'd be OK with making the docstring bool(self) instead, if that's people's preference.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@gvanrossum, @terryjreedy, @merwok, @sweeneyde: please review the changes made to this pull request.

@terryjreedy terryjreedy dismissed their stale review February 21, 2022 02:40

The kind of change I would like is not sensibly possible.

@miss-islington
Copy link
Contributor

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

@bedevere-bot
Copy link

GH-31473 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed needs backport to 3.10 only security fixes needs backport to 3.9 only security fixes labels Feb 21, 2022
@bedevere-bot
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2022
(cherry picked from commit 0a222db)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2022
(cherry picked from commit 0a222db)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington added a commit that referenced this pull request Feb 21, 2022
(cherry picked from commit 0a222db)


Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
miss-islington added a commit that referenced this pull request Feb 21, 2022
(cherry picked from commit 0a222db)


Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@JelleZijlstra
Copy link
Member Author

Thanks everyone for the reviews and feedback!

hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
)

(cherry picked from commit 0a222db)


Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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.

None yet