Skip to content

Docs: standardize boolean constants in stdtypes.rst #133325

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Yzi-Li
Copy link
Contributor

@Yzi-Li Yzi-Li commented May 3, 2025

Replaces lowercase true/false with standard boolean values True/False.


📚 Documentation preview 📚: https://cpython-previews--133325.org.readthedocs.build/

@@ -2371,7 +2371,7 @@ expression support in the :mod:`re` module).
.. method:: str.swapcase()

Return a copy of the string with uppercase characters converted to lowercase and
vice versa. Note that it is not necessarily true that
Copy link
Member

Choose a reason for hiding this comment

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

That seems correct for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think == operator should return a boolean like True/False.

Copy link
Member

Choose a reason for hiding this comment

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

This sentence is not about return value of ==.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant the next line s.swapcase().swapcase() == s should return a boolean.

Copy link
Contributor

Choose a reason for hiding this comment

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

The word "true" in that sentence is not meant to be a return value (True), it is simply the English word true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have considered this situation, but I think True is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is wrong, as it is not a return value like I and Sergey have told you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh, maybe I misunderstood this sentence. Actually, I have considered if it should be changed. I just think we should use Python boolean when using Python comparing expression like == operator.

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 anyway!

@skirpichev
Copy link
Member

@Yzi-Li, please avoid using "Update branch" button, unless you do something meaningful, e.g. fix a merge conflict.

@Yzi-Li
Copy link
Contributor Author

Yzi-Li commented May 3, 2025

Sorry, but I just want to revert the commit.

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 skip news
3 participants