Skip to content

Commit ca4cfca

Browse files
committed
Add a note on the absence of APIs to replace builtins for conditionals.
1 parent 5f8bd98 commit ca4cfca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/draft/design_topics/lazy_eager.rst

+2
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ A common code construct where this happens is conditional logic, e.g.::
2121
# The if-statement will make Python call the __bool__ method
2222
# on the result of `all(vals)`.
2323
do_something_else()
24+
25+
Note that the API does not contain control flow constructs that would allow avoiding the implicit `__bool__` call in the example above. The only control flow-like function is `where`, but there's no function like `cond` to replace an `if`-statement.

0 commit comments

Comments
 (0)