[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

Aaron Meurer report at bugs.python.org
Mon Nov 13 21:39:24 EST 2017


Aaron Meurer <asmeurer at gmail.com> added the comment:

If it's of any interest to this discussion, for SymPy (for some time) we have used a custom subclass of DeprecationWarning that we enable by default https://github.com/sympy/sympy/blob/master/sympy/utilities/exceptions.py. I don't know if there are major libraries that do something similar. 

Our reasoning is that we really do want everybody to see the warnings. Obviously direct users of SymPy (both interactive users and library developers) need to see them so they can fix their code. But also if library X uses a deprecated behavior and a user of library X sees a deprecation warning for SymPy inside of library X, that incentivises them to bug the library X developers to fix the behavior (or PR it). The whole point of warnings as we see it is to be as loud as possible while still keeping things working, to avoid the situation where things stop working (when the deprecated behavior is removed). 

And +<however many points I'm allowed to have> to Nathaniel's point that DeprecationWarnings are about more than just the standard library. Tons of libraries use the built in warnings, and the default warnings behavior makes no distinction between warnings coming from the standard library and warnings coming from other places.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24294>
_______________________________________


More information about the Python-bugs-list mailing list