Chris schrieb: > If all you wanted was some grouping of exceptions why not something > like... > > soft_exception_list = [IndexError, TypeError] > hard_exception_list = [ZeroDivision] > > try: > do_something() > except Exception, e: > if e.__class__ in soft_exception_list: > handle_soft_exception() > elif e.__class__ in hard_exception_list: > handle_hard_exception() > else: > raise NotImplementedError > > Granted you're most likely looking for something that does this > constantly on every line of code though...
It's not about grouping, which would be done better with inheritance by the way. Its about not raising certain exceptions if there is no handler. Diez -- http://mail.python.org/mailman/listinfo/python-list