Author vstinner
Recipients vstinner
Date 2019-10-27.16:02:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572192125.35.0.636716899488.issue38604@roundup.psfhosted.org>
In-reply-to
Content
Python 3.3 deprecated the C API functions using Py_UNICODE type. Examples in the doc:

* https://docs.python.org/dev/c-api/unicode.html#c.Py_UNICODE
* https://docs.python.org/dev/c-api/unicode.html#deprecated-py-unicode-apis

Currently, functions removal is scheduled for Python 4.0 but I would prefer that Python 4.0 doesn't have a long list of removed features, but no more than usual. So I'm trying to remove a few functions from Python 3.9, and try to prepare removal for others.

Py_UNICODE C API was mostly kept for backward compatibility with Python 2. Since Python 2 support ends at the end of the year, can we start to organize Py_UNICODE C API removal?

There are multiple questions:

* Should we drop the whole API at once? Or can we/should we start by removing a few functions, and then the others?
* Deprecation warnings are emitted at compilation. But I'm not aware of DeprecationWarning emited at runtime. IMHO we should emit DesprecationWarning at runtime during at least one release, so most developers ignore compilation warnings.

I propose to:

* (Right now) write an exhaustive list of all deprecated APIs: functions, constants, types, etc.
* Modify C code to emit DeprecationWarning at runtime in Python 3.9
* Experiment a modified Python without these APIs and test how many projects are broken by this removal: see PEP 608
* Schedule the actual removal of all these APIS from Python 3.10

Honestly, if the removal is causing too much issues, I'm fine to make slowdown the removal. It's just a matter of clearly communicating our intent.

Maybe we should also announce the scheduled removal in What's in Python 3.9 and in the capi-sig mailing list.
History
Date User Action Args
2019-10-27 16:02:05vstinnersetrecipients: + vstinner
2019-10-27 16:02:05vstinnersetmessageid: <1572192125.35.0.636716899488.issue38604@roundup.psfhosted.org>
2019-10-27 16:02:05vstinnerlinkissue38604 messages
2019-10-27 16:02:04vstinnercreate