Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-40360: Prepare to deprecate lib2to3. #19645

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/library/2to3.rst
Original file line number Diff line number Diff line change
@@ -3,6 +3,12 @@
2to3 - Automated Python 2 to 3 code translation
===============================================

.. deprecated:: 3.9
The :mod:`lib2to3` package and related 2to3 tool are pending deprecation
and removal by Python 3.11 or 3.12. We anticipate that a fork of it may
live on as an external package on PyPI as it does have use as a Python to
Python source transformation tool.

.. sectionauthor:: Benjamin Peterson <benjamin@python.org>

2to3 is a Python program that reads Python 2.x source code and applies a series
@@ -462,6 +468,11 @@ and off individually. They are described here in more detail.
.. moduleauthor:: Collin Winter
.. moduleauthor:: Benjamin Peterson <benjamin@python.org>

.. deprecated:: 3.9
The :mod:`lib2to3` package and related 2to3 tool are pending deprecation
and removal by Python 3.11 or 3.12. We anticipate that a fork of it may
live on as an external package on PyPI.

**Source code:** :source:`Lib/lib2to3/`

--------------
6 changes: 5 additions & 1 deletion Lib/lib2to3/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#empty
import warnings
warnings.warn(
"lib2to3 is pending deprecation for removal in Python 3.11 or 3.12.",
category=PendingDeprecationWarning)
del warnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib2to3 and the 2to3 tool gain a PendingDeprecationWarning, slated for
removal in 3.11 or 3.12.