Jim Jewett <jimjjew...@users.sourceforge.net> added the comment:

<blockquote>Does anyone think that it is simpler to register two different 
callbacks than one? </blockquote>

Moderately, yes.

Functions that actually help with cleanup should normally be run only in one 
phase; it is just stats-gathering and logging functions that might run both 
times, and I don't mind registering those twice.

For functions that are run only once (which I personally think is the more 
normal case), the choices are between

    @register_gc
    def my_callback(actually_run_flag, mydict):
        if not actually_run_flag:
            return
        ...

vs

    @register_gc_before
    def my_callback(mydict):
        ...

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to