Decorators without function

Gregory Ewing greg.ewing at canterbury.ac.nz
Tue Aug 10 02:48:54 CEST 2010


Vedran wrote:

> @plot_decorator(fig_params1)
> def plt():
> 	pylab.plot(..first graph data...)
> 	pylab.plot(..second graph data..)	
> plt()

You could do something like

def call(f):
     f()

@call
@plot_decorator(fig_params1)
def plt():
	pylab.plot(..first graph data...)
	pylab.plot(..second graph data..)	

-- 
Greg



More information about the Python-list mailing list