Skip to content

Commit

Permalink
Slightly improve clarity of logical bool ops
Browse files Browse the repository at this point in the history
The doc states that these "return true" but more precisely they're the "typical"
short-circuiting boolean operations with Python-like semantics. ``and`` and ``or`` may
not return booleans at all depending on their inputs.
  • Loading branch information
sirosen committed Dec 16, 2024
1 parent d680a95 commit f92a2c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1410,13 +1410,13 @@ For ``if`` statements, ``for`` filtering, and ``if`` expressions, it can be usef
combine multiple expressions:

``and``
Return true if the left and the right operand are true.
For ``x and y``, if ``x`` is false, then the value is ``x``, else ``y``.

``or``
Return true if the left or the right operand are true.
For ``x or y``, if ``x`` is true, then ``x``, else ``y``.

``not``
negate a statement (see below).
Negate a statement (see below).

``(expr)``
Parentheses group an expression.
Expand Down

0 comments on commit f92a2c1

Please sign in to comment.