title: Python - Conditionally Catching Exceptions
body: <p>Is it possible to conditionally catch exceptions in python? I would like to be able to write a function so that the caller can decide who handles the exception.</p>
  <p>Basically, I would like something like this:</p>
  <pre><code>def my_func(my_arg, handle_exceptions):
      try:
          do_something(my_arg)
      except Exception as e if handle_exceptions:
          print &quot;my_func is handling the exception&quot;
  </code></pre>
  <p>I know I could write some kludgy code that does what I want, but I want a pythonic answer if there is one.<br />
  Thanks.</p>