Skip to content

fix case in case.py #95258

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

Closed
wants to merge 1 commit into from
Closed

fix case in case.py #95258

wants to merge 1 commit into from

Conversation

Berserker66
Copy link

No description provided.

@ghost
Copy link

ghost commented Jul 25, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@Berserker66
Copy link
Author

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

I doubt this needs a news entry.

@sweeneyde
Copy link
Member

sweeneyde commented Jul 26, 2022

I don't think this change should be made. "This thing is not false" is an English description, not a Python expression. This is the same as the docstring of these methods.

I think capitalizing suggests that these methods do if expr is not False: fail() and if expr is not True: fail(), which is incorrect; what they actually do are if expr: fail() and if not expr: fail().

@rhettinger
Copy link
Contributor

As Dennis noted, the wording is correct as-is. We use True and False for the exact boolean objects. We use true and false for any object treated as true or false during branching. For example, the number 15 is a true value but is not the object True.

>>> x = 15
>>> if x:
...     print(x, 'treated as true for branching purposes')
... 
15 treated as true for branching purposes

>>> x is True
False

@rhettinger rhettinger closed this Aug 9, 2022
@Berserker66 Berserker66 deleted the patch-1 branch August 9, 2022 01:24
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.

4 participants