[issue31975] Add a default filter for DeprecationWarning in __main__

Nick Coghlan report at bugs.python.org
Thu Nov 9 20:44:23 EST 2017


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Antoine, it's not a wishy-washy compromise, it's a compromise based on the fact that code that has been factored out to a support module is far more likely to have a test suite than code that's directly in __main__.

Thus the logic for the revised default filters is as follows:

* code running in __main__ will see deprecation warnings when it runs
* code running outside __main__ will see deprecation warnings when its test suite runs

If someone is publishing code that's not in a main module, and they *don't* have a test suite for that code yet, then they have bigger problems to worry about than not seeing deprecation warnings.

----------

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


More information about the Python-bugs-list mailing list