[Python-3000] atexit module problems/questions

skip at pobox.com skip at pobox.com
Mon Aug 6 14:02:12 CEST 2007


    Nick> a) functools.partial isn't that hard to use

Never heard of it and I've been writing Python since the mid-90's.  The
point is that not everybody dreams in a functional programming style.

    Nick> b) we could create it automatically in atexit.register and return
    Nick>    it

That's a possibility, though I'm still inclined to think returning an
ever-increasing int (which is already available as the index into the array)
is cleaner and would be microscopically more efficient) is the way to go.
In the no-arg case you'd just return the function which was passed in.  Is
creating and returning a closure going to be a challenge for Jython or
IronPython?

Changing the focus of this thread a bit, this all seems to be getting a bit
baroque.  Maybe we should back up and ask why atexit needed to be recast in
C in the first place.  Can someone enlighten me?  At some level it seems
more like gratuitous bug insertion than a true necessity.

Skip



More information about the Python-3000 mailing list