Chance Ginger <[EMAIL PROTECTED]> writes: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > >> Chance Ginger" wrote: >> >>> If I define a decorator like: >>> >>> def t(x) : >>> def I(x) : return x >>> return I >> >> ... you get a syntax error. >> > > It isn't a syntax error...I tried it before I posted. In fact > def t(x) : > def I(x) : return x > return I > > is correct.
Indeed. This is correct. Fredrick's comment was related to the lack of indentation in your code. > >>> and use it like: >>> >>> @t(X) >>> def foo(a) : >>> # definition of foo... >>> pass >> >> that's also a syntax error. > > Once again this isn't an error assuming you pass in a valid 'X'. If your indentation is broken as above it doesn't matter what 'X' is. -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer coisa dita em latim soa profundo. - Anything said in Latin sounds smart. -- http://mail.python.org/mailman/listinfo/python-list