oripel:

Maybe this is a silly suggestion, the docstring is already overloaded,
but it may be used for this too:

def foo():
    """
    ...
    ...
    @ATTR name="Xander"
    @ATTR age=10
    @ATTR hobby="knitting"
    """
    ...

(Or somethins similar without the @). Later you can retrive the
attributes from the docstring, for example using a verbose RE like:
r"\s* @ATTR \s+ (\w*) \s* = \s* (.*)"
And you use it to create a dict of attributes.
The decorators you apply to foo() must keep its docstring too.

Bye,
bearophile

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to