[Python-Dev] PEP 565: Show DeprecationWarning in __main__

Nick Coghlan ncoghlan at gmail.com
Sun Nov 12 18:34:06 EST 2017


On 13 November 2017 at 03:10, Serhiy Storchaka <storchaka at gmail.com> wrote:
> 12.11.17 11:24, Nick Coghlan пише:
>>
>> The PEP also proposes repurposing the existing FutureWarning category
>> to explicitly mean "backwards compatibility warnings that should be
>> shown to users of Python applications" since:
>>
>> - we don't tend to use FutureWarning for its original nominal purpose
>> (changes that will continue to run but will do something different)
>
> FutureWarning currently is used for its original nominal purpose in the re
> and ElementTree modules.

If the future warnings relate to regex and XML parsing, they'd still
fall under the "for display to users" category, since those modules
can't tell if the input data was application provided or part of an
end user interface like a configuration file.

> It even had been added in 2.7 for behavior that
> already have been changed in Python 3 or will be changed in future versions
> (emitted only with the -3 option).

That's closer to the original purpose, but with them being 2.7 only,
and gated behind the -3 switch, I think we can ignore them when it
comes to defining the expected usage in 3.7+

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list