[Python-Dev] Garbage announcement printed on interpreter shutdown
brett at python.org
Sat Sep 11 20:57:15 CEST 2010
On Fri, Sep 10, 2010 at 14:55, Daniel Stutzbach
<daniel at stutzbachenterprises.com> wrote:
> On Fri, Sep 10, 2010 at 3:32 PM, Georg Brandl <g.brandl at gmx.net> wrote:
>> IMO this runs contrary to the decision we made when DeprecationWarnings
>> made silent by default: it spews messages not only at developers, but also
>> users, who don't need it and probably are going to be quite confused by
>> assuming it came from their console application (imagine Mercurial
> A non-empty gc.garbage often indicates that there is a bug in the program
> and that it is probably leaking memory . That's a little different from
> a DeprecationWarning which doesn't indicate a bug; it just indicates that
> the program might not run correctly using a future version of Python. I
> think a better comparison would be with exceptions throw from a __del__,
> which (as far as I know) are still printed to the console.
Sure, but exceptions printed out by a __del__ method during
interpreter shutdown are not explicitly done as part of the shutdown
process, they just happen to typically be triggered by a shutdown.
This gc info, OTOH, is explicitly debugging information that is only
printed out (typically) at shutdown and thus at a point where it will
no longer effect semantics or the performance of the application. So I
view this as entirely debugging information and thus in no way
critical for a user to know about.
> +1 on adding a way to enable/disable the feature.
> -1 on removing the feature
> -0 on making it disabled by default
>  I know that some large, long-running programs periodically check
> gc.garbage and carefully choose where to break cycles, but those are the
> exception and not the rule.
> Daniel Stutzbach, Ph.D.
> President, Stutzbach Enterprises, LLC
> Python-Dev mailing list
> Python-Dev at python.org
More information about the Python-Dev