[Python-ideas] Before and after the colon in funciton defs.

Bruce Leban bruce at leapyear.org
Fri Sep 23 04:39:16 CEST 2011


On Thu, Sep 22, 2011 at 7:27 PM, Devin Jeanpierre <jeanpierreda at gmail.com>wrote:

>
> I still like real decorators because they can be applied at run-time
> instead of just compile-time, which gives them additional use-cases.
>
>
The $inject special decorator would need to be recognized at compile time
but would be applied at run time just as @decorators are. That is, I see no
reason this couldn't work:

def foo(a):
   $inject(b=a)
   def bar(c): return b+c
   return bar

--- Bruce
Follow me: http://www.twitter.com/Vroo http://www.vroospeak.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110922/2f85a6d1/attachment.html>


More information about the Python-ideas mailing list