This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jimjjewett
Recipients asvetlov, jimjjewett, kristjan.jonsson, lehmannro, pitrou, stutzbach
Date 2010-12-03.15:29:11
SpamBayes Score 0.0020837416
Marked as misclassified No
Message-id <1291390154.41.0.493759271178.issue10576@psf.upfronthosting.co.za>
In-reply-to
Content
<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):
        ...
History
Date User Action Args
2010-12-03 15:29:14jimjjewettsetrecipients: + jimjjewett, pitrou, kristjan.jonsson, lehmannro, stutzbach, asvetlov
2010-12-03 15:29:14jimjjewettsetmessageid: <1291390154.41.0.493759271178.issue10576@psf.upfronthosting.co.za>
2010-12-03 15:29:11jimjjewettlinkissue10576 messages
2010-12-03 15:29:11jimjjewettcreate