🌐 AI搜索 & 代理 主页
Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ These are the Boolean operations, ordered by ascending priority:
+-------------+---------------------------------+-------+
| Operation | Result | Notes |
+=============+=================================+=======+
| ``x or y`` | if *x* is false, then *y*, else | \(1) |
| | *x* | |
+-------------+---------------------------------+-------+
| ``x and y`` | if *x* is false, then *x*, else | \(2) |
| ``x or y`` | if *x* is True, then *x*, else | \(1) |
| | *y* | |
+-------------+---------------------------------+-------+
| ``x and y`` | if *x* is True and *y* is True, | \(2) |
| | then True, else False | |
Copy link
Contributor

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

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

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.

+-------------+---------------------------------+-------+
| ``not x`` | if *x* is false, then ``True``, | \(3) |
| | else ``False`` | |
+-------------+---------------------------------+-------+
Expand Down