From ddcf6fd179b7cbbbcf807f2825938417dd7b1094 Mon Sep 17 00:00:00 2001 From: Colin Caine Date: Sun, 7 Feb 2021 17:38:08 +0000 Subject: [PATCH] Add `Base.isdone(itr::EachLine)` With this method, `isempty` won't consume values from the iterator (See #27412). --- base/io.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/io.jl b/base/io.jl index eb9eff598f712..56137519858b0 100644 --- a/base/io.jl +++ b/base/io.jl @@ -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