Skip to content

Commit c4500d6

Browse files
committed
Rewrite the deprecation/removal timeline
1 parent 3893bfa commit c4500d6

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

peps/pep-0784.rst

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,35 @@ Other compression modules
197197
New import names ``compression.lzma``, ``compression.bz2``, and
198198
``compression.zlib`` will be introduced in Python 3.14 re-exporting the
199199
contents of the existing ``lzma``, ``bz2``, and ``zlib`` modules respectively.
200-
Starting with Python 3.19, the existing modules will emit a deprecation warning
201-
on import. In Python 3.24, the existing modules will be removed and code must
202-
use the ``compression`` sub-modules. The documentation for these modules will be
203-
updated to discuss the planned deprecation and removal.
204200

205201
The ``_compression`` module, given that it is marked private, will be
206202
immediately renamed to ``compression._common.streams``. The new name was
207203
selected due to the current contents of the module being I/O related helpers
208204
for stream APIs (e.g. ``LZMAFile``) in standard library compression modules.
209205

206+
Compression module migration timeline
207+
-------------------------------------
208+
209+
Existing modules will emit a ``DeprecationWarning`` in the Python
210+
release following the last Python without the ``compression`` module leaving
211+
support. For example, if the ``compression`` namespace is introduced in 3.14,
212+
then the ``DeprecationWarnings`` would be emitted in 3.19, the next release
213+
after 3.13 reaches end of life. Following the standard deprecation timeline
214+
specified in :pep:`387`, in Python 3.24 the existing modules will be removed
215+
and code must use the ``compression`` sub-modules. The documentation for these
216+
modules will be updated to discuss the planned deprecation and removal
217+
timelines.
218+
219+
210220
Backwards Compatibility
211221
=======================
212222

213223
The main compatibility concern is usage of existing standard library
214224
compression APIs with the existing import names. These names will be
215-
deprecated, and will be removed in 3.24. Given the long deprecation period,
216-
most users will likely migrate to the new import names well before then.
217-
Additionally, a libCST codemod can be provided to automatically rewrite
218-
imports, easing the migration.
225+
deprecated in 3.19 and will be removed in 3.24. Given the long coexistance of
226+
the modules and a 5 year deprecation period, most users will likely migrate to
227+
the new import names well before then. Additionally, a libCST codemod can be
228+
provided to automatically rewrite imports, easing the migration.
219229

220230
Security Implications
221231
=====================

0 commit comments

Comments
 (0)