[Python-Dev] Re: method decorators (PEP 318)

Paul Moore pf_moore at yahoo.co.uk
Sat Mar 27 06:03:22 EST 2004


"Mike Rovner" <mike at nospam.com> writes:

> Given that attributes are part of function object dictionary,
> and defined at function definition time like docstring,
> why not:
>
> def func(atr):
>   {author="Guido", deprecated=True}
>   '''doc'''
>   pass
>
> Presumably {attributes} will be like "doc": only allowed immediately after
> def (interchangebly with "doc") and do no harm in other places.

I quite like this (although it ought to be a real dictionary literal,
ie {'author': 'Guido', 'deprecated': True}, which doesn't read quite
as well.

But I still think this is a separate issue from PEP 318.

Paul
-- 
This signature intentionally left blank




More information about the Python-Dev mailing list