Kay Schluehr wrote:

> A new cookbook recipe suggesting two decorators @throws and @catches
> for treatment of checked exceptions in Python:
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498131
> 
> This might be of practical interest for some and theoretical interest
> for others - in particular those who know checked ex as a language
> feature of Java.

Probably not what you wanted:

>>> test()
Raises UncheckedExceptionError(exceptions.ZeroDivisionError) -> OK
Raises ZeroDivisionError -> OK
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "checked_exceptions.py", line 134, in test
    test4(3,2)
UnboundLocalError: local variable 'test4' referenced before assignment

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to