(func, *targs, **kargs)
return func
register a function to be executed upon normal program termination

    func - function to be called at exit
    targs - optional arguments to pass to func
    kargs - optional keyword arguments to pass to func

    func is returned to facilitate usage as a decorator.
register a function to be executed upon normal program termination
register a function to be executed upon normal program termination
def register(func, *targs, **kargs):
    """register a function to be executed upon normal program termination

    func - function to be called at exit
    targs - optional arguments to pass to func
    kargs - optional keyword arguments to pass to func

    func is returned to facilitate usage as a decorator.
    """
    _exithandlers.append((func, targs, kargs))
    return func
def register ( func , * targs , * * kargs ) : _exithandlers . append ( ( func , targs , kargs ) ) return func