Re: Decorator Syntax

2011-03-22 Thread Rafe Kettler
On Mar 21, 8:59 pm, Mike Patterson wrote: > In my Python class the other day, the professor was going over > decorators and he briefly mentioned that there had been this huge > debate about the syntax and using the @ sign to signify decorators. > > I read about the alternative forms proposed here

Re: Decorator Syntax

2011-03-22 Thread Laurent Claessens
And I'm willing to bet that there are plenty of scripts out there that use "dec" as a name for Decimal objects. You won. I owe you a beer ;) Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator Syntax

2011-03-21 Thread Ian Kelly
On Mon, Mar 21, 2011 at 7:31 PM, Benjamin Kaplan wrote: > On Mon, Mar 21, 2011 at 8:59 PM, Mike Patterson > wrote: >> In my Python class the other day, the professor was going over >> decorators and he briefly mentioned that there had been this huge >> debate about the syntax and using the @ sign

Re: Decorator Syntax

2011-03-21 Thread Benjamin Kaplan
On Mon, Mar 21, 2011 at 8:59 PM, Mike Patterson wrote: > In my Python class the other day, the professor was going over > decorators and he briefly mentioned that there had been this huge > debate about the syntax and using the @ sign to signify decorators. > > I read about the alternative forms p

Re: Decorator Syntax For Recursive Properties

2005-04-17 Thread Jeffrey Froman
Peter Otten wrote: >> something like this didn't work for me: > But this will, I suppose: > > @property > def ancestors(self): > if self.parent: > return self.parent.ancestors + [self.parent] > return [] > > A non-recursive variant: > > @property > def ancestors(self): > r

Re: Decorator Syntax For Recursive Properties

2005-04-17 Thread Peter Otten
Jeffrey Froman wrote: > it is the originating node (the node trying to find its ancestors). So > something like this didn't work for me: > > @property > def ancestors(self): > if self.parent is None: > return [self.name] > return [self.name] + self.parent.ancestors But this will,

Re: decorator syntax polling suggestion

2005-04-01 Thread D H
Jeremy Bowers wrote: On Fri, 01 Apr 2005 16:52:52 -0500, Jeremy Bowers wrote: Oops, sorry, some "send later" messages I thought were gone got sent. Sorry. Didn't mean to revive dead threads. At least it happened on April Fool's. Or should I say: @aprilfools def happened: at least -- http://mail

Re: decorator syntax polling suggestion

2005-04-01 Thread Jeremy Bowers
On Fri, 01 Apr 2005 16:52:52 -0500, Jeremy Bowers wrote: Oops, sorry, some "send later" messages I thought were gone got sent. Sorry. Didn't mean to revive dead threads. -- http://mail.python.org/mailman/listinfo/python-list

Re: decorator syntax polling suggestion

2005-04-01 Thread Jeremy Bowers
On Fri, 13 Aug 2004 16:49:53 +1000, Anthony Baxter wrote: > The > people who hate pie-decorators post a _lot_ - most people seem to either > not care, or else post once or twice and then disappear. I just posted on another mailing list about how posting the same message, over and over, is fundamen