What is the formal process of retiring a Public API function

In relation to this bpo issue, there is a discussion to remove PyGen_NeedsFinalizing() which is a public API but not used anymore in the codebase.

Am wondering, What conditions do you take into consideration to make the decision of deleting functions that are part of the Public API? Is this even advised?

1 Like

The first thing to do would be to search for open source / publicly available code that calls that function. You could try e.g. with https://searchcode.com .

Perhaps also find if some recipes or question answers on the Web (e.g. on StackOverflow) mention that function.

2 Likes

Needless to say, the function should be deprecated before it’s removed. See https://github.com/python/cpython/pull/14804 for an example.

1 Like