RELEASED Python 2.4, alpha 2

Anthony Baxter anthonybaxter at gmail.com
Thu Aug 5 18:43:41 CEST 2004


On Fri, 6 Aug 2004 02:41:10 +1000, Anthony Baxter
<anthonybaxter at gmail.com> wrote:
> On Thu, 5 Aug 2004 12:29:51 -0400, Christopher T King <squirrel at wpi.edu> wrote:
> > What does one do if a decorator raises an exception?
> 
> def deco(func):
>       raise TypeError
> 
> @deco
> def foo():
>     print "hello"

Sigh. I missed this bit of cut-n-paste:

Traceback (most recent call last):
  File "f.py", line 4, in ?
    @deco
  File "f.py", line 2, in deco
    raise TypeError
TypeError



More information about the Python-list mailing list