On 18 November 2017 at 11:22, Victor Stinner <victor.stin...@gmail.com> wrote: > 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?
I don't recall the exact reasoning (if I ever even knew it), but if I had to guess, it would just be because ResourceWarning is newer than the others. BytesWarning has its own control flags and shouldn't be on by default even in debug builds, but I think it would be reasonable to have at least ImportWarning (which our own test suite should never be hitting) and DeprecationWarning on by default in debug builds. For PendingDeprecationWarning, I don't really mind either way, but "everything except BytesWarning, because that has its own dedicated command line flags" would be an easier guideline to remember. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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