Skip to content

Commit

Permalink
Add Base.isdone(itr::EachLine)
Browse files Browse the repository at this point in the history
With this method, `isempty` won't consume values from the iterator (See JuliaLang#27412).
  • Loading branch information
cmcaine authored Feb 7, 2021
1 parent 59808cb commit ddcf6fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,8 @@ eltype(::Type{<:EachLine}) = String

IteratorSize(::Type{<:EachLine}) = SizeUnknown()

isdone(itr::Eachline) = eof(itr.stream)

struct ReadEachIterator{T, IOT <: IO}
stream::IOT
end
Expand Down

0 comments on commit ddcf6fd

Please sign in to comment.