Applying a decorator to a module

lkcl luke.leighton at
Thu Nov 27 20:33:17 CET 2008

Very simple question: how do you apply a decorator to an entire
module?  an idea whose time has properly arrived is to merge pyjamas
( into web2py (, and to do that,
it's necessary to "identify" functions, classes, global variables and
modules that should be compiled into javascript, rather than executed

i figured that the best pythonic way would be to put a decorator on an
entire module, if the entire module was to be compiled to javascript.

... however, i don't know how to do that!

@decorate(module) ?

import modulename


should this work?

many thanks,


More information about the Python-list mailing list