Decorators without function

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Aug 9 20:48:54 EDT 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