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

Allow deprecating stable functions/features #9

Open
encukou opened this issue Oct 23, 2020 · 6 comments
Open

Allow deprecating stable functions/features #9

encukou opened this issue Oct 23, 2020 · 6 comments

Comments

@encukou
Copy link
Owner

encukou commented Oct 23, 2020

Old functions would need to be available forever, but they could be deprecated at build time.
Maybe they could even be removed for newer Py_LIMITED_API (but still be available at run time).

@encukou encukou changed the title Allow deprecating stable functions Allow deprecating stable functions/features Nov 16, 2020
@encukou
Copy link
Owner Author

encukou commented Jun 1, 2021

@vstinner, it seems you're interested in deprecating in the Limited API / Stable ABI.
Do you have a list of what you'd like to deprecated? Or just one thing you'd like to be gone?
It would be nice to do this with a relevant example :)

@vstinner
Copy link

vstinner commented Jun 1, 2021

In a perfect world, I would like to remove almost all functions of the Python C API :-) Only 2 or 3 functions should be enough for everyone :-D

In the meanwhile, I would like to remove PyEval_InitThreads(). Deprecated in 3.9, PyEval_InitThreads() now does nothing. See https://bugs.python.org/issue44117 and python/cpython#26070

In Python main branch:

void
PyEval_InitThreads(void)
{
    /* Do nothing: kept for backward compatibility */
}

@encukou
Copy link
Owner Author

encukou commented Jun 8, 2021

That is an example of a function I'd not want to remove in abi3. Keeping it doesn't hurt anyone.

@encukou
Copy link
Owner Author

encukou commented Oct 21, 2021

A candidate for removal is the old buffer protocol (see https://bugs.python.org/issue41103), but only after the new API is available in Limited ABI (https://bugs.python.org/issue45459):
- PyObject_AsCharBuffer
- PyObject_AsReadBuffer
- PyObject_AsWriteBuffer
- PyObject_CheckReadBuffer

@encukou
Copy link
Owner Author

encukou commented Oct 21, 2021

Static types are another candidate: https://bugs.python.org/issue40601

@encukou encukou added this to abi3 Dec 22, 2021
@encukou
Copy link
Owner Author

encukou commented Nov 7, 2022

PySlice_GetIndices/PySlice_GetIndicesEx are another candidate: https://discuss.python.org/t/is-pyslice-getindices-still-used/20778

PySequence_Fast is another candidate: python/cpython#91417

And more: Py_TPFLAGS_HAVE_FINALIZE, Py_TPFLAGS_HAVE_VERSION_TAG, PY_TIMEOUT_MAX, anything marked abi-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants