From deedc79fd12ce69a6ae04d23a5954560bb2a30fe Mon Sep 17 00:00:00 2001 From: Brant Watson Date: Mon, 20 Jan 2020 13:00:27 -0600 Subject: [PATCH] Implement seekable, readable, and writable methods https://docs.python.org/2/library/io.html#io.IOBase.seekable https://docs.python.org/3/library/io.html#io.IOBase.seekable https://docs.python.org/2/library/io.html#io.IOBase.writable https://docs.python.org/3/library/io.html#io.IOBase.writable https://docs.python.org/2/library/io.html#io.IOBase.readable https://docs.python.org/3/library/io.html#io.IOBase.readable These methods should be implemented on all file like objects. --- boltons/ioutils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boltons/ioutils.py b/boltons/ioutils.py index f1ade1f..5ac8ae4 100644 --- a/boltons/ioutils.py +++ b/boltons/ioutils.py @@ -170,6 +170,12 @@ class SpooledIOBase(object): def seekable(self): return True + def readable(self): + return True + + def writable(self): + return True + __next__ = next def __len__(self):