enhancements decorators

DagSverreSeljebotn edited this page Aug 22, 2008 · 3 revisions
Clone this wiki locally


  • Status: Support for functions implemented

This is low-hanging fruit, especially now that classmethods have been done.

See http://www.python.org/dev/peps/pep-0318/


def eggs(...):

Turns into

def eggs(...):
eggs = spam(eggs)

but with eggs being stored in a temporary variable rather than the given scope. There is a little trickery because function are not actually defined on the fly at runtime, but it shouldn't be too bad.

StefanBehnel: The funny thing is that class decorators should even be easier to implement than function decorators.