[Python-Dev] Removing PendingDeprecationWarning

Serhiy Storchaka storchaka at gmail.com
Fri Mar 22 07:49:19 EDT 2019


22.03.19 12:51, Jeroen Demeyer пише:
> On 2019-03-22 11:33, Serhiy Storchaka wrote:
>> What is wrong with PendingDeprecationWarning?
> 
> It serves the same purpose as DeprecationWarning: it indicates that a 
> feature is planned to be removed in the future. There is no point in 
> having two warnings with exactly the same meaning.

But does not flood the end user with warnings, so you can continue to 
use deprecated features for a while. This makes the transition more smooth.

>> What problem do you want
>> to solve at the cost of removing this feature?
> 
> 1. Typically, a PendingDeprecationWarning is meant to be promoted to a 
> DeprecationWarning in some future release. It takes a minor effort to do 
> that and it may be forgotten. It's just simpler to use 
> DeprecationWarning from the start.

What is wrong if it be forgotten?

Simpler does not mean better.

> 2. Whenever somebody wants to deprecate something, that person has to 
> decide between the two. That's just more complicated than it needs to be.

If he want to provide a more smooth transition way, he should start with 
a PendingDeprecationWarning. Otherwise he can use a DeprecationWarning.

> And I can easily ask the converse question: what problem do you want to 
> solve by including that feature?

It allowed to mark a feature deprecated for developers without harming 
the end users.



More information about the Python-Dev mailing list