Skip to content

Commit a58dc52

Browse files
authored
clear up isdone docstring (#58958)
I got pretty confused on my first reading of this docstring because for some reason I thought it was saying that `isdone(itr, state) == missing` implied that it was true that `iterate(itr, state) === nothing` (aka that `state` is indeed final). which of course is wrong and doesn't make sense, but it's still how I read it. I think the new docstring is a bit more explicit.
1 parent 3705629 commit a58dc52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

base/essentials.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,9 @@ Stateful iterators that want to opt into this feature should define an `isdone`
12251225
method that returns true/false depending on whether the iterator is done or
12261226
not. Stateless iterators need not implement this function.
12271227
1228-
If the result is `missing`, callers may go ahead and compute
1229-
`iterate(x, state) === nothing` to compute a definite answer.
1228+
If the result is `missing`, then `isdone` cannot determine whether the iterator
1229+
state is terminal, and callers must compute `iterate(itr, state) === nothing`
1230+
to obtain a definitive answer.
12301231
12311232
See also [`iterate`](@ref), [`isempty`](@ref)
12321233
"""

0 commit comments

Comments
 (0)