Hi, I noticed that Python not only hides DeprecationWarning, but also PendingDeprecationWarning and ImportWarning by default. While I understand why we decided to hide these warnings to users for a Python compiled in release mode, why are they hidden in Python debug builds?
I'm asking the question because in debug mode, Python shows ResourceWarning warnings (whereas these warnings are hidden in release mode). Why only displaying ResourceWarning, but not other warnings in debug mode? At least, with the Python 3.7 new "developer mode" (-X dev), now you can be totally annoyed^W^W appreciate *all* these warnings :-) Example: ------------------ $ cat x.py import warnings warnings.warn('Resource warning', ResourceWarning) warnings.warn('Deprecation warning', DeprecationWarning) # Release build: ignore all :-( $ python3 x.py # Debug build: ignore deprecation :-| $ ./python x.py x.py:2: ResourceWarning: Resource warning warnings.warn('Resource warning', ResourceWarning) # Developer mode: show all :-) $ ./python -X dev x.py x.py:2: ResourceWarning: Resource warning warnings.warn('Resource warning', ResourceWarning) x.py:3: DeprecationWarning: Deprecation warning warnings.warn('Deprecation warning', DeprecationWarning) ------------------ Or maybe we should start adding new modes like -X all-warnings-except-PendingDeprecationWarning, -X I-really-really-love-warnings and -X warnings-hater, as Barry proposed? Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com