[Python-Dev] method decorators (PEP 318) (original) (raw)
Peter Otten Peter.Otten at t-online.de
Fri Mar 26 17:05:49 EST 2004
- Previous message: [Python-Dev] method decorators (PEP 318)
- Next message: [Python-Dev] Re: method decorators (PEP 318)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yet another variant that deals with "passive" metadata - make the first dictionary special just like the first string.
def foobar(): ... { author = "van Rossum", ... deprecated = True } ... foobar.deprecated True
Even better, stash it all away in a another attribute:
foobar.meta {"author": "van Rossum", "deprecated": "not yet"}
This would work for functions, classes and modules alike. Fitting in nicely: the alternative spelling for all dictionaries.
{alpha="value", beta="another value"}
Peter Otten
- Previous message: [Python-Dev] method decorators (PEP 318)
- Next message: [Python-Dev] Re: method decorators (PEP 318)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]