Message123253
| 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):
... |
|