Open ditman opened 1 day ago
Summary: User finds Iterable.any
documentation unclear. The current wording implies a complete iteration before returning, while it short-circuits.
Old docs are often quite terse. Makes sense to write something more here.
I was reading the docs for
Iterable.any
and it says this:At first I thought that it'd check
every
(all) element in iteration order, then returntrue
if any of them makes test return true.But the implementation actually returns immediately:
I think something like this may be clearer:
"Checks elements in iteration order, and returns
true
when any of them makestest
returntrue
, otherwise returns false."(This maybe too subtle a change for my level of english, though 😅)