Decorator syntax (was Re: PEP 318 - PyFIT comments)
Iñigo Serna
inigoserna at terra.es
Fri Aug 6 15:03:24 EDT 2004
Hi,
after thinking all day I hope I've found the option I like more:
#decorator
def func (cls, *args, **kw):
pass
... and it's compatible with old versions of python :)
seriously, I prefer next options, they are more readable:
1)
def func (cls, *args, **kw):
.deco
pass
2)
def func (cls, *args, **kw):
__deco__
pass
i.e., not before or inside function definition.
Best regards,
Iñigo
El jue, 05-08-2004 a las 07:32 -0700, Michele Simionato escribió:
> "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> wrote in message news:<mailman.1162.1091660561.5135.python-list at python.org>...
> > Personally, I don't overly like the new syntax - I much preferred def
> > func (args) [decorators] - and I would have preferred not to "waste" @
> > for them, but I can definitely live with the decision. Some usable
> > decorator syntax is IMO more important than none.
> This also my opinion, more or less. It is just the "@" which is ugly.
> Why not to overload (once more) the colon and write:
>
> :classmethod
> def func (cls, *args, **kw):
> pass
>
> ? Only half serious ...
>
> Michele Simionato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Esta parte del mensaje est? firmada digitalmente
URL: <http://mail.python.org/pipermail/python-list/attachments/20040806/a3a93da4/attachment.sig>
More information about the Python-list
mailing list