
March 18, 2010
8:34 a.m.
On Thu, Mar 18, 2010 at 2:49 AM, nbv4 <nbvfour@gmail.com> wrote:
@printable=True def some_func(*args, **kwargs): return "sup"
Any thoughts?
If you have that many properties, there's no need to extend the syntax, just do something like: def prop(**props): def wee(f): f.__dict__.update(props) return f return wee @prop(printable=True, other_prop="yo!") def some_func(): return "sup, %s" % some_func.other_prop print some_func() # prints "sup, yo!"