contextlib.ExitStack.callback()

callback(callback, *args, **kwds)

Accepts an arbitrary callback function and arguments and adds it to the callback stack.

Unlike the other methods, callbacks added this way cannot suppress exceptions (as they are never passed the exception details).

The passed in callback is returned from the function, allowing this method to be used as a function decorator.

doc_python
2016-10-07 17:29:20
Comments
Leave a Comment

Please login to continue.