Message244147
DeprecationWarning and PendingDeprecationWarning are invisible by default. The rationale for this is that they are only useful to people who are writing code, so they should not be shown to end-users who are merely running code.
If someone is typing stuff into the interactive REPL, though, and the code they type uses some deprecated functionality, then we should actually show them this warning. We know that the author is sitting right there. And they're probably going to take whatever they tested interactively and move it into a more permanent form and ugh.
This problem is particularly acute for packages that are primarily used through the interactive prompt, like numpy. I am tired of getting bugs like this: https://github.com/numpy/numpy/issues/5919
The solution is simple: when entering interactive mode, the REPL should do something like:
warnings.filterwarnings("default", category=DeprecationWarning, module="__main__")
warnings.filterwarnings("default", category=PendingDeprecationWarning, module="__main__") |
|
Date |
User |
Action |
Args |
2015-05-27 08:06:30 | njs | set | recipients:
+ njs |
2015-05-27 08:06:30 | njs | set | messageid: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> |
2015-05-27 08:06:30 | njs | link | issue24294 messages |
2015-05-27 08:06:30 | njs | create | |
|