Skip to content

Commit 5754473

Browse files
authored
Document isdone as part of the iterator interface (#43099)
It's a necessary method to implement when defining a mutable custom iterator. See https://discourse.julialang.org/t/isempty-enumerate-iterators-stateful-advances-the-stateful-iterator/71475
1 parent bc8337a commit 5754473

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/src/manual/interfaces.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ to generically build upon those behaviors.
1717
| `eltype(IterType)` | `Any` | The type of the first entry of the tuple returned by `iterate()` |
1818
| `length(iter)` | (*undefined*) | The number of items, if known |
1919
| `size(iter, [dim])` | (*undefined*) | The number of items in each dimension, if known |
20+
| `Base.isdone(iter[, state])` | `missing` | Fast-path hint for iterator completion. Should be defined for mutable iterators, or else `isempty(iter)` will call `iterate(iter[, state])` and may mutate the iterator. |
2021

2122
| Value returned by `IteratorSize(IterType)` | Required Methods |
2223
|:------------------------------------------ |:------------------------------------------ |

0 commit comments

Comments
 (0)