Repository navigation
Implement PEP 784 - Adding Zstandard to the Python standard library #132983
Description
Activity
- addedextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
on Apr 26, 2025 It's something I should have asked on discourse, but is
compressionthe final name of the public module? I see in the PEP that we want to mimichashlib.algorithms_guaranteedas well and one way to mitigate the name shadowing is to actually usecompressionlibas the name (we have hashlib, annotationlib, and we could have compressionlib as well; I also thinkcompressionlibis a less likely name to be chosen but it's not the best one as well). Feel free to ignore this question as the PEP has been accepted.It's something I should have asked on discourse, but is compression the final name of the public module?
Yes, the decision was to use
compression. A search of Github code showed that it was used very infrequently. Literally one in a million files https://discuss.python.org/t/pep-784-adding-zstandard-to-the-standard-library/87377/66Reacted by Bénédikt Tran and Gregory P. SmithReacted by stonebig- added a commit that references this issue
on Apr 27, 2025 I've had a go at adding support for building on Windows in #133366, let me know thoughts.
A
- added a commit that references this issue
on May 4, 2025 It looks like there are a couple of problems with the
configure.acchanges to discover and check libzstd.172 remaining items
Load more actions- added a commit that references this issue
on Aug 7, 2025 - added 4 commits that reference this issue
on Aug 19, 2025 - added 3 commits that reference this issue
on Sep 9, 2025 - added 7 commits that reference this issue
on Jun 2, 2026
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Feature or enhancement
This is a tracking issue for implementing PEP 784. See the PEP text for more details.
Since the diff is significant (~10k lines) I wanted to split up the PRs a bit.
Implementation Plan:
compressionmodule just re-exporting existing compression modules. Move the_compressionmodule._zstdnative module with Unix build config_zstd(blocked on addinglibzstdto cpython-source-deps) and SBOM config.zstdPython module with testszstd_train_dictand_finalize_dictto share common codetest_zstdfailed on ubuntu with free-threading #133885optionsvalue can't be converted to intLinked PRs
compressionpackage and move_compressionmodule #133018_zstdbindings module #133027compression._commona full-fledged package #133076compression.zstdand Python tests #133365_zstdon Windows #133366compression.zstd#133547_zstd#133670_zstd(GH-133674) #133695_zstd(GH-133670) #133756_zstd_exec()#133775_zstd_exec()(GH-133775) #133786_zstdmodule.h#133793_zstdmodule.h(GH-133793) #133854__new__methods to Argument Clinic (GH-133860) #133915_zstd_set_c_parameters#133921mt_continue_should_break()(GH-133947) #133950compression.zstd(GH-133547) #134001test.pythoninfo#134230ZstdDict()(GH-133924) #134723_zstd_set_c_parameters(GH-133921) #134838ZstdDict(GH-137321) #137343Py_UNREACHABLEin_zstd_load_impl()(GH-137320) #137360