Re: a question about decorator

2007-10-22 Thread Bruno Desthuilliers
Trent Nelson a écrit : (snip (rather convoluted) decorator example) > When Python first parses your code, every time it runs into '@A', it > calls A() in order to get the required decorator function. It's not happening at parsing time, but when the (decorated) def statement is executed - that is

RE: a question about decorator

2007-10-22 Thread Trent Nelson
> def A(): > print 'warp in A' > def why(self, *arg, **kw): > print 'in A' > print self > print arg > print kw > #self(*arg, **kw) > > return why > > class T(object): > @A() > def test(g, out): >

Re: a question about decorator

2007-10-22 Thread Marc 'BlackJack' Rintsch
On Mon, 22 Oct 2007 14:37:36 +0800, kyo guan wrote: > def A(): > print 'warp in A' > def why(self, *arg, **kw): > print 'in A' > print self > print arg > print kw > #self(*arg, **kw) > > return why >