[Python-Dev] Garbage announcement printed on interpreter shutdown (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sat Sep 11 02:17:18 CEST 2010
- Previous message: [Python-Dev] Garbage announcement printed on interpreter shutdown
- Next message: [Python-Dev] Garbage announcement printed on interpreter shutdown
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Sep 11, 2010 at 9:42 AM, Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:
On Sep 10, 2010, at 5:10 PM, Amaury Forgeot d'Arc wrote:
2010/9/10 Fred Drake <fdrake at acm.org>: On Fri, Sep 10, 2010 at 4:32 PM, Georg Brandl <g.brandl at gmx.net> wrote:
IMO this runs contrary to the decision we made when DeprecationWarnings were made silent by default: it spews messages not only at developers, but also at users, who don't need it and probably are going to be quite confused by it,
Agreed; this should be silent by default. +1. I suggest to enable it only when PyDEBUG (or PyTRACEREFS or PyREFDEBUG?) is defined. Would it be possible to treat it the same way as a deprecation warning, and show it under the same conditions? It would be nice to know if my Python program is leaking uncollectable objects without rebuilding the interpreter.
My suggestion:
- Add a gc.WARN_UNCOLLECTABLE flag on gc.set_debug that enables the warning message.
- Have regrtest explicitly set this for our own test suite
As far as automatically turning it on for third party test suites goes, we could either:
- require them to turn it on explicitly via gc.set_debug
- have gc.WARN_UNCOLLECTABLE default to true for non-optimised runs (debug == True) and false for runs with -O or -OO (debug == False)
- set it by looking at the -W arguments passed in at interpreter startup (e.g. enable it when all warnings are enabled, leave it disabled by default otherwise)
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] Garbage announcement printed on interpreter shutdown
- Next message: [Python-Dev] Garbage announcement printed on interpreter shutdown
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]