Skip to content

Commit

Permalink
Add a note on the absence of APIs to replace builtins for conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Nov 16, 2023
1 parent 5f8bd98 commit ca4cfca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/draft/design_topics/lazy_eager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ A common code construct where this happens is conditional logic, e.g.::
# The if-statement will make Python call the __bool__ method
# on the result of `all(vals)`.
do_something_else()

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 comments on commit ca4cfca

Please sign in to comment.