You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In stream2py objects, is there a way to check if a stream is open?
io.IOBase (so, subclasses that you probably use regularly (when opening a file etc)) has a close (which stream2py.source_reader.SourceReader has), but also has a closed (which SourceReader doesn't).
The added value of consistency with the builtin io interface, if and when the correspondence makes sense.
We don't need to subclass io.BaseIO (which I've always found awkward to deal with, and comes with many methods that are not meant for general streams). But closed seems to have a fairly consistent meaning.
Perhaps it's just a matter of putting a
closed=property(BufferReader.is_stopped) # alias to be consistent with `io` interface
and the same in StreamBuffer.
Shouldn't we have this in SourceReader as well? Defaulted to True? Required?
Adding closed property is good for consistency. And also rename StreamBuffer's start and stop to open and close. And add a deprecation warning for start, stop, is_running, is_stopped.
Shouldn't we have this in SourceReader as well? Defaulted to True? Required?
I don't see any significant value in adding closed to SourceReader since the intent is to only have StreamBuffer interacting with SourceReader so any added properties and methods would not be used.
In
stream2py
objects, is there a way to check if a stream is open?io.IOBase
(so, subclasses that you probably use regularly (when opening a file etc)) has a close (whichstream2py.source_reader.SourceReader
has), but also has a closed (whichSourceReader
doesn't).Would be useful to have one.
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: