> If someone fails to use the defined protocol, screw 'em... ;-) That's unreasonable given that existing tools might include a library which might be upgraded to use the new mechanism while the old code used its own mechanism happily. For example, I've used my own protocols in the past which went something like... def register_exitfunc(func): old_exitfunc = getattr(sys, 'exitfunc', None) def wrapper(old_exitfunc=old_exitfunc, new_func=func): if old_exitfunc is not None: old_exitfunc() new_func() sys.exitfunc = wrapper or some such, creating a call chain instead of a sequence of calls, and it's a 'fine' protocol in that it worked fine in the absence of a standard. No need to break code if we can avoid it. The point of my pseudo-patch, if it wasn't clear, was that if a function is already in sys.exitfunc, then it should still be called on exit after the new exit module is imported. You're right that my patch didn't properly check that _run_exitfuncs might be that function. --david
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4