classification
Title: Remove the formatter module, deprecated since Python 3.4
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, vstinner
Priority: normal Keywords: patch

Created on 2020-01-16 08:48 by vstinner, last changed 2020-03-25 16:33 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18023 closed vstinner, 2020-01-16 08:53
Messages (4)
msg360098 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-16 08:48
The formatter module has been deprecated in Python 3.4 by bpo-18716: commit 1448ecf470013cee63c0682f615c5256928dc6b0.

In 2014, its removal was scheduled in Python 3.6: commit 29636aeaccaf6a1412e0dc7c230db29cccf68381.

But bpo-25407 cancelled the removal from Python 3.6: commit 5ad5a7d31f5328c73df523b6ade330d88573717e

"The new PEP 4 policy of any module existing in both 2.7 and 3.5 applies here, hence the module will be with us for a bit longer."

In the meanwhile, I'm not aware of anyone opposed to the removal.

Python 2.7 reached it's end of life, so I propose to remove the module:
https://docs.python.org/3.8/library/formatter.html

If someone needs this module, it's a single formatter.py file: it can easily be copied from Python 3.8. The intent here is to reduce the size of the standard library to remove the maintenance burden on Python core developers.

Note: I'm surprised, but it seems like the formatter module has no test!?

Attached PR removes the module.
msg360099 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-16 08:57
I did a quick & dirty code search in GitHub to check for "import formatter". There is no "import formatter" in the 5 first pages of code search in the Python programming language. IMHO it seems that this module is basically unused. To be honest, I even didn't know that it existed!?
msg360213 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2020-01-17 20:35
This is already covered in https://www.python.org/dev/peps/pep-0594/ for removal in 3.10, so probably best to help get that PEP accepted first then deal with the removal.
msg364999 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-25 16:33
I'm no longer sure that it's a good idea to remove a module from the stdlib without providing a solution for the few people relying on it. I removed dummy_threading module in Python 3.9 and obviously it broke an application (bodhi): https://bugzilla.redhat.com/show_bug.cgi?id=1814243

I should think about a way to move removed stdlib modules to PyPI, but I would prefer to have a formal PEP process for that.

In the meanwhile, I close this PR.
History
Date User Action Args
2020-03-25 16:33:26vstinnersetstatus: open -> closed
resolution: rejected
messages: + msg364999

stage: patch review -> resolved
2020-01-17 20:35:51brett.cannonsetmessages: + msg360213
2020-01-16 08:57:15vstinnersetmessages: + msg360099
2020-01-16 08:53:18vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request17419
2020-01-16 08:48:01vstinnercreate