2 ms·
I had to change my public APIs in a backwards-incompatible way. I had a method something like obj.to_string("abc") to convert the object into a string in 'abc'
by eesmith 6y ago
I had to change my public APIs in a backwards-incompatible way. I had a method something like obj.to_string("abc") to convert the object into a string in 'abc' format.
I also supported things like obj.to_string("abc.gz") to get the record in gzip-compressed form.
I also had a from_string() -> obj functions.
You can see the problem. I had to change to_string() so it didn't allow compression (breaking backwards compatibility) and add a to_bytes() for that functionality, and add type dispatching in the from_string() code to support either byte or strings, with different code paths.
And change all the open() calls to use "b", and to add type checks on user-passed-in file objects to insist on reading bytes (if not isinstance(user_file.read(0), bytes) raise "Must be open in binary mode") because all of the underlying parsers are in C and the needless decode/encode step adds overhead.
Oh, and re-write the C extension so it handles both Python 2 and Python 3.
That was a really boring 6 weeks.