This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients CanisUrsa, steven.daprano
Date 2020-11-17.21:53:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605650005.67.0.201322723388.issue42394@roundup.psfhosted.org>
In-reply-to
Content
This is not a bug, it is normal handling of `and` and `or` operators since Python 1.5 and possibly older.

The `and` and `or` operators are *short-cut* operators. This is intentional design, so we can write things like:

    if mylist and mylist[0] == value:

the `mylist[0] == value` expression is only evaluated if `mylist` is a truthy value.

This is all documented here:

https://docs.python.org/3/reference/expressions.html#boolean-operations
History
Date User Action Args
2020-11-17 21:53:25steven.dapranosetrecipients: + steven.daprano, CanisUrsa
2020-11-17 21:53:25steven.dapranosetmessageid: <1605650005.67.0.201322723388.issue42394@roundup.psfhosted.org>
2020-11-17 21:53:25steven.dapranolinkissue42394 messages
2020-11-17 21:53:25steven.dapranocreate