
I was only talking about the very specific case of Py_TYPE(), Py_REFCNT() and Py_SIZE() used as l-value.
For other removed C functions, we do add deprecation warnings and try to have at least one release with these warnings. For example, all functions using Py_UNICODE are deprecated.
Recently (1 or 2 years ago?), the warnings were modified to also be emitted using Visual Studio C compiler (MSC).
Examples of usage of the Py_DEPRECATED macro:
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_Encode( const Py_UNICODE *s, /* Unicode char buffer */ Py_ssize_t size, /* number of Py_UNICODE chars to encode */ const char *encoding, /* encoding */ const char *errors /* error handling */ );
Victor
Le jeu. 4 juin 2020 à 19:50, Petr Viktorin <encukou@gmail.com> a écrit :
On 2020-06-04 18:37, Victor Stinner wrote:
Compiler warnings for deprecation and deprecation in the documentation are good. But in my experience, even if a deprecation is documented for 10 years, people only start to pay attention when the compilation actually fails.
Not *all* people.
I don't think you can count the projects that take the warning into account. You only see the projects that ignore the warning until it's too late. If you remove things without a warning, you're not even giving anyone a fair chance to update their code.
Le jeu. 4 juin 2020 à 16:46, Petr Viktorin <encukou@gmail.com> a écrit :
On 2020-06-04 15:56, Victor Stinner wrote:
Hi Petr,
(I already replied to some of your questions in my reply to Hugh.)
Le jeu. 4 juin 2020 à 12:09, Petr Viktorin <encukou@gmail.com> a écrit :
I see that the current documentation of Py_TYPE, Py_REFCNT ans Py_SIZE suggest that using them as lvalues is perfectly valid. There is no mention that anything changed.
Oh, it seems like https://docs.python.org/dev/ is no longer updated for an unknown reason.
The documentation was updated.
If you look into the up to date Git repository, Py_TYPE() got a ".. versionchanged:: 3.10" markup, and the change is mentioned in "Porting to Python 3.10: C API Changes" section of What's New in Python 3.10. https://github.com/python/cpython/blob/master/Doc/c-api/structures.rst
AFAIK, the deprecation period should be at least a release. Wouldn't that translate to documenting the new behavior 3.10, but only actually breaking in 3.11?
-- Night gathers, and now my watch begins. It shall not end until my death.