Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make a default flush(io)=nothing method for all IO streams #16403

Merged
merged 4 commits into from
May 18, 2016

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented May 17, 2016

I noticed that there is no flush(::IOBuffer) function, even as a no-op, which makes it error-prone to write generic code that operates on IO streams. See JuliaPlots/Plots.jl#258 and JuliaPy/PyCall.jl#272.

This PR just adds a generic flush(io::IO)=nothing fallback method, which should be safe since flush is only loosely defined in terms of side effects anyway.

@stevengj stevengj added the io Involving the I/O subsystem: libuv, read, write, etc. label May 17, 2016
@StefanKarpinski
Copy link
Member

Wasn't there a recent change to make all flush methods return nothing? I'm fine with returning the IO object or nothing but we should be consistent.

@stevengj
Copy link
Member Author

stevengj commented May 17, 2016

@StefanKarpinski, ah, thanks, I didn't notice that change (#16076). Will fix.

@stevengj stevengj changed the title make a default flush(io)=io method for all IO streams make a default flush(io)=nothing method for all IO streams May 17, 2016
@stevengj
Copy link
Member Author

stevengj commented May 17, 2016

Is the AppVeyor failure spurious? Looks like the output just stops randomly. Trying again.

@stevengj
Copy link
Member Author

Yay, tests are green. Should be good to merge.

@tkelman tkelman merged commit f5593f8 into JuliaLang:master May 18, 2016
@stevengj stevengj deleted the flushbuffer branch May 18, 2016 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants