>> I can see a situation where you might register the same function
    >> multiple times with different argument lists, yet unregister takes
    >> only the function as the discriminator.

    Greg> One way to fix this would be to remove the ability to register
    Greg> arguments along with the function. It's not necessary, as you can
    Greg> always use a closure to get the same effect. Then you have a
    Greg> unique handle for each registered callback.

Then you need to hang onto the closure.  That might be some distance away
from the point at which the function was registered.  Returning a unique id
corresponding to the specific call to atexit.register is much simpler the
than forcing the caller to build a closure.

Skip

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to