-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
base: main
Are you sure you want to change the base?
Conversation
Doc/library/stdtypes.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 ==
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks anyway!
@Yzi-Li, please avoid using "Update branch" button, unless you do something meaningful, e.g. fix a merge conflict. |
Sorry, but I just want to revert the commit. |
This reverts commit de2ddea.
Replaces lowercase
true
/false
with standard boolean valuesTrue
/False
.📚 Documentation preview 📚: https://cpython-previews--133325.org.readthedocs.build/