1. Nick Coghlan
  2. contextlib2
  3. Issues
Issue #10 wontfix

Support conditional callbacks "on_error" and "on_success"

Nick Coghlan
repo owner created an issue

These methods would be roughly equivalent to ExitStack.callback(), but add conditional guards such that "on_success" callbacks are skipped if an exception occurs and "on_error" callbacks are skipped if an exception does occur.

Comments (5)

  1. Nick Coghlan reporter

    Rejecting this, as you could do something equivalent by writing an appropriate context manager and adding that to the stack instead of using the callback API directly.

  2. Log in to comment