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

gh-100556: Better or doc working #100589

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

gh-100556: Better or doc working #100589

wants to merge 5 commits into from

Conversation

ramvikrams
Copy link
Contributor

@ramvikrams ramvikrams commented Dec 28, 2022

gh-100556: changed the or documentation

Copy link

@AlexandroLuis AlexandroLuis left a comment

i wonder how and works if there's no comparison
just
if x is false: x else: y
and not
if x is True and y is True: True else: False

@ramvikrams
Copy link
Contributor Author

ramvikrams commented Dec 29, 2022

i wonder how and works if there's no comparison
just
if x is false: x else: y
and not
if x is True and y is True: True else: False

Thanks will do the change

| | *y* | |
+-------------+---------------------------------+-------+
| ``x and y`` | if *x* is True and *y* is True, | \(2) |
| | then True, else False | |
Copy link
Contributor

@slateny slateny Dec 30, 2022

Choose a reason for hiding this comment

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

I think you misunderstood the other comment, as this now doesn't cover something like

>>> [] and [1]
[]

Copy link
Contributor Author

@ramvikrams ramvikrams Dec 30, 2022

Choose a reason for hiding this comment

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

could you please tell then how should it be framed, bcoz I am not able to think of it

Choose a reason for hiding this comment

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

if x and y, then True, else False

it covers if it's Null, empty, False...

Copy link
Contributor Author

@ramvikrams ramvikrams Dec 30, 2022

Choose a reason for hiding this comment

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

thanks i'll do it

Copy link
Contributor

@slateny slateny Dec 31, 2022

Choose a reason for hiding this comment

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

The original mention of 'true'/'false' refers to all truthy and falsey values, which include 0, None, empty lists, etc., and saying True excludes those as True refers to just the boolean value. I also don't think that it's all that helpful for a table to have an entry to say x and y then its explanation also say x and y, so I would actually recommend just sticking with the original for this and section.

Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants