Skip to content

Conversation

@Rogdham
Copy link

@Rogdham Rogdham commented Dec 13, 2025

Summary

Context

Thanks to PEP-784, Zstandard is included in Python starting from version 3.14 with the compression.zstd module.

So for Python 3.14+, we don't need an external lib. For older version of Python, I'm using backports.zstd which exposes the same API as stdlib.

This also means that users of Python 3.14+ will benefit from Zstandard support even if they install httpx instead of httpx[zstd].

A similar change has been adopted in various other libraries already, such as urllib3 from version 2.6.0.

Full disclosure: I'm the author and maintainer of backports.zstd, and the maintainer of pyzstd (which code was used as a base for the integration into Python). I also helped with PEP-784 and its integration into CPython.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@Rogdham Rogdham mentioned this pull request Dec 13, 2025
3 tasks
@Rogdham
Copy link
Author

Rogdham commented Dec 13, 2025

Hello @mbeijen, as the author of Zstandard support in httpx your review would be appreciated! 🤗

@mbeijen
Copy link
Contributor

mbeijen commented Dec 15, 2025

Thanks for your work, this looks great (esp. together with #3726 !!!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants