stitchfix/splits — pull request #3 by thmsmlr (2014-08-14 22:37:25+00:00)
Title: Follow file-like object spec more closely

This commit fixes the writer and the reader to not callously remove
newline characters. It now behaves more like a proper file-like object.
Furthermore, this commit fixes the reader to handle the optional
parameters on read() and readline().

## Newlines
The example below shows how the write and read function should work. This commit makes SplitWriter behave as below.
```python

with open('/tmp/test.txt', 'w') as w:
w.writelines(['foo', 'bar'])
w.writelines(['baz\n', 'baa'])

print open('/tmp/test.txt', 'r').read()
# => 'foobarbaz\nbaa'
```

## Reading N Chars
This commit abides the `read()` and `readline()` spec by allow us to read variable number of chars. Also this commit makes sure that we don't return `StopIteration()` but rather an empty string, as per the spec.