Formalize the concept of "soft deprecation" (don't schedule removal) in PEP 387 "Backwards Compatibility Policy"

Having N:M replacements is perfectly fine.
But writing them all down should be a prerequisite for removing API.

1 Like

Over the last years, IMO the quality of instructions to get rid of deprecated and removed functions improved in What’s New In Python documents. Sure, there is always room for enhancement, and contributions are welcomed :slight_smile: Recently, I enhanced imp removal docs (Python 3.12) to provide recipes to replace removed APIs.

The most difficult part is to provide a solution working on old and new Python versions. If possible, a solution for that should always be provided.

I expect that there is usually not going to be an exact one to one replacement but it is good to remember that it is what the reader ideally wants. If a perfect replacement can be provided then there is probably not a good reason for deprecation in the first place (just have the old API call the replacement and leave it soft-deprecated). Usually though there will be easy replacements for the most obvious/common usage even if a perfect replacement is not possible.

Mainly it is just good to show any clear example of how the deprecated API might have been used and what a better/updated version could be. Remember that the reader might not have heard of this API before and might have no idea how to use it. Just learning the API enough to confirm a fix might be the bulk of the work from their perspective.