'Creates a StreamReaderWriter instance.
stream must be a Stream-like object.
Reader, Writer must be factory functions or classes
providing the StreamReader, StreamWriter interface resp.
Error handling is done in the same way as defined for the
StreamWriter/Readers.'

def __init__(self, stream, Reader, Writer, errors='strict'):

    self.stream = stream
    self.reader = Reader(stream, errors)
    self.writer = Writer(stream, errors)
    self.errors = errors
