[Python-Dev] Please reconsider PEP 479.

Nick Coghlan ncoghlan at gmail.com
Tue Nov 25 06:54:27 CET 2014


On 25 November 2014 at 10:47, Guido van Rossum <guido at python.org> wrote:
> In my defense, the docs for the warnings module on docs.python.org at start
> like this:
>
> "Warning messages are typically issued in situations where it is useful to
> alert the user of some condition in a program, where that condition
> (normally) doesn’t warrant raising an exception and terminating the program.
> For example, one might want to issue a warning when a program uses an
> obsolete module."
>
> I admit that's only a single example, but it does refer to something that
> will break in the future.

The logging tutorial also recommends limiting the use of
warning.warn() to cases where the code triggering the warning can and
should be changed to avoid the warning:
https://docs.python.org/3/howto/logging.html#when-to-use-logging

Vinay explicitly noted it there to contrast with the fact that
logging.warn() is for cases that are dubious and should potentially be
investigated by the application developer, but there's no specific
code change to be made to avoid the warning.

Cheers,
Nick.

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


More information about the Python-Dev mailing list