> The patch contains a special case for writing only one bytes object.
> This is very unlikely case.
The patch only modify a few functions to make them use the new _PyBytesWriter API. Other functions can use it.
A few examples:
- PyBytes_FromObject()
- binascii: binascii_rledecode_hqx()
- bz2, lzma and zlib modules
- marshal and pickle modules
- datetime.datetime.strftime()
- Python/compile.c: assemble_lnotab()
- more Unicode decoders
But I agree that the readonly "hack" can be removed from _PyBytesWriter API since the bytes type has no format method (no bytes%args nor bytes.format(args)). |