Re: Decorators using instance variables

2008-08-27 Thread Paul Boddie
On 27 Aug, 13:32, Bruno Desthuilliers wrote: > > This _sometimes_ happens, yes, and that's why you just shouldn't trust > him : unless you have a good knowledge of the topic, you just can't tell > whether his answer is ok or total rubbish. Can everyone just be done graduating from high school and

Re: Decorators using instance variables

2008-08-27 Thread Bruno Desthuilliers
Robert Kaplan a écrit : Bruno Desthuilliers a écrit : <...> 2/ don't bother reading anything from someone named 'castironpi', it's one of our currently active resident troll, and he is worse than clueless. Actually, I found his response to the point, his sample code helpful, and his so

Re: Decorators using instance variables

2008-08-27 Thread Ben Finney
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Robert Kaplan wrote: > > > Actually, I found his response to the point, his sample code > > helpful, and his solution similar to yours. > > given how your original code looked and how pointless it was, are > you sure you're not just another alias for t

Re: Decorators using instance variables

2008-08-27 Thread Fredrik Lundh
Robert Kaplan wrote: Actually, I found his response to the point, his sample code helpful, and his solution similar to yours. given how your original code looked and how pointless it was, are you sure you're not just another alias for the same guy? -- http://mail.python.org/mailman/listin

Re: Decorators using instance variables

2008-08-26 Thread Robert Kaplan
Bruno Desthuilliers a écrit : <...> 2/ don't bother reading anything from someone named 'castironpi', it's one of our currently active resident troll, and he is worse than clueless. Actually, I found his response to the point, his sample code helpful, and his solution similar to yours.

Re: Decorators using instance variables

2008-08-26 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : robert2821 a écrit : (snip - sorry, hit the 'send' button too soon) def getdec(f): dec = decorator(f) return dec.docall class decorator: def __init__ (self, f): self.f = f def docall (self, *a): return self.f(*a) class test: @ge

Re: Decorators using instance variables

2008-08-26 Thread Bruno Desthuilliers
robert2821 a écrit : Hi, I'm new; greetings all! Hello. Since you're new here, first a couple advises: 1/ the python mailing list is relayed to the comp.lang.python usenet newsgroup (from where I'm reading your post and answering it), so please avoid attachments. Either put the full code i

Re: Decorators using instance variables

2008-08-21 Thread castironpi
On Aug 21, 9:22 pm, robert2821 <[EMAIL PROTECTED]> wrote: > Hi, > > I'm new; greetings all! > > I'm wondering if the following program should work.  I think it should > print 'Hello, World', but instead it produces a TypeError.  Is this a > bug in decorators, a feature of them, or a mistake or misu

Decorators using instance variables

2008-08-21 Thread robert2821
Hi, I'm new; greetings all! I'm wondering if the following program should work. I think it should print 'Hello, World', but instead it produces a TypeError. Is this a bug in decorators, a feature of them, or a mistake or misunderstanding on my part? TIA, Bob defgetdec (f):