[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

STINNER Victor report at bugs.python.org
Tue Feb 18 06:26:29 EST 2020


New submission from STINNER Victor <vstinner at python.org>:

Following discussion on python-dev, I propose to revert the removal of a few deprecated functions to keep them in Python 3.9, and only remove them in Python 3.10. Please see the following email for the longer rationale, and the discussion for further details:

https://mail.python.org/archives/list/python-dev@python.org/thread/EYLXCGGJOUMZSE5X35ILW3UNTJM3MCRE/

With Python 3.8, it was possible to have a single code base working on Python 2.7 and 3.8. Some functions emits DeprecationWarning, but these warnings are ignored (silent) by default. With removed deprecated functions in Python 3.9, *new* code is required to support Python 2.7. The problem is that Python 2.7 is no longer supported. Adding new code to support Python 2.7 sounds painful. Dropping Python 2.7 support isn't free. Projects have to drop Python 2 code, drop CI tests on Python 2, warn users, etc.

The idea is to give maintainers one more year (until Python 3.10) to organize their project to schedule properly the removal of Python 2 support. The first motivation is to ease adoption of Python 3.9.

--

I propose to start with reverting the removal of collections aliases to Abstract Base Classes (ABC) like collections.Mapping alias to collections.abc.Mapping. Removing these aliases is the change which caused most issues when testing Python projects on Python 3.9.

I also propose to modify the What's New In Python 3.9 document to strongly suggest to test your applications with -W default or even -W error to see DeprecationWarning and PendingDeprecationWarning.

----------
components: Library (Lib)
messages: 362196
nosy: vstinner
priority: normal
severity: normal
status: open
title: Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39674>
_______________________________________


More information about the Python-bugs-list mailing list