[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

Gregory P. Smith report at bugs.python.org
Sun Apr 11 15:57:56 EDT 2021


Gregory P. Smith <greg at krypto.org> added the comment:

I left some review comments on the PR.  I like the algorithm being used.  

I don't really _like_ that this is a .h file acting as a C template to inject effectively the same static code into each module that wants to use it...  Which I think is the concern Victor is expressing in a comment above.

I could live with this PR as is because it is at least easy to maintain.  But I anticipate we'll want to refactor it in the future to be shared code instead of a copy compiled per module.

This is the kind of thing that also makes sense to be usable outside of just these modules.  Compression modules for the other popular compression algorithms currently not in the stdlib but available on PyPI shouldn't need to reinvent this wheel on their own without reason. (lzo, brotli, zstandard, no doubt others...)

It is also worth looking at those to see if they've already implemented something like this and how it differs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41486>
_______________________________________


More information about the Python-bugs-list mailing list