Message137098
I seem to be unable to log in to rietveld, so I'll reply here.
>> result += decomp.decompress(data)
> Is this efficient? I understood that other Python implementations
> had poorly performing str.__iadd__, and therefore that using a list
> was the common idiom (using “return b''.join(result)” at the end).
Good point. I hadn't thought about other implementations.
Also, you're right about the superfluous comments in test_bz2; I'll do a
general cleanup of the test code soon.
> Looks good. I only have one paranoid comment: since the tests use
> self.TEXT * 5 to create multiple streams, the ordering of the files is
> not tested. IOW, the code could mix-up the order of the files and the
> tests would not catch that. Is it a concern?
I wouldn't think so. It's not as though there is an index that the code
looks at to find the location of each stream. It just reads the data from
the file and if it reaches the end of one stream, it assumes that the
following data is a new stream, and decompresses it accordingly.
That said, I wouldn't be opposed to adding a test for that sort of thing
(just for paranoia's sake :P) if it doesn't involve adding large amounts
of additional binary data in the file. I'll come back to it once I've
tidied up the existing code. |
|
Date |
User |
Action |
Args |
2011-05-27 21:37:03 | nadeem.vawda | set | recipients:
+ nadeem.vawda, loewis, akuchling, niemeyer, pitrou, therve, thomaslee, djc, eric.araujo, nirai, r.david.murray, dbonner, Kontr-Olli, python-dev |
2011-05-27 21:37:03 | nadeem.vawda | set | messageid: <1306532223.16.0.250208370477.issue1625@psf.upfronthosting.co.za> |
2011-05-27 21:37:02 | nadeem.vawda | link | issue1625 messages |
2011-05-27 21:37:02 | nadeem.vawda | create | |
|