traveler.core.compression.IO#

class traveler.core.compression.IO#

Bases: Generic

Generic base class for TextIO and BinaryIO.

This is an abstract, generic version of the return of open().

NOTE: This does not distinguish between the different possible classes (text vs. binary, read vs. write vs. read/write, append-only, unbuffered). The TextIO and BinaryIO subclasses below capture the distinctions between text vs. binary, which is pervasive in the interface; however we currently do not offer a way to track the other distinctions in the type system.

Methods#

close()

fileno()

flush()

isatty()

read([n])

readable()

readline([limit])

readlines([hint])

seek(offset[, whence])

seekable()

tell()

truncate([size])

writable()

write(s)

writelines(lines)

Attributes#