and it doesn't seem as closely tied syntactically.
Of course, that's all opinion. But what's done is done; it's doubtful
that the decorator syntax will ever change significantly.
Rafe
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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 (http://
www.python.org/dev/peps/pep-0318/#syntax-al
Thanks a lot, all of you! This was really helpful. (or at least give
me the inspiration I needed to finish it.)
I'm sure this is a use case where most other options are less readable
than the chain of methods in the decorator.
In this use case, I had a lot of Django views to which access
permissio
a...@pythoncraft.com (Aahz) writes:
> In article <4b54998...@dnews.tpgi.com.au>,
> Lie Ryan wrote:
>>
>>If you are sure you can put up a convincing argument for lifting this
>>restriction, and you are willing to put some time arguing, you are
>>welcome to start a thread in the python-dev mailing
In article <4b54998...@dnews.tpgi.com.au>,
Lie Ryan wrote:
>
>If you are sure you can put up a convincing argument for lifting this
>restriction, and you are willing to put some time arguing, you are
>welcome to start a thread in the python-dev mailing list. Be sure to
>read about previous discus
Jonathan S wrote:
> Hi all,
> The following is what I want to do, but this results in a syntax
> error:
>
>
> @news_page('template.html').lookup(News, 'news_id', 'news')
> def view(request, group, news):
> pass
>
>
> What does work is the equivalent old way of doing decorating:
>
>
> def
e since Guido has a "gut feeling" that
allowing arbitrary expression in decorator syntax severely harms
readability.
http://mail.python.org/pipermail/python-dev/2004-August/046711.html
A workaround is to put an assignment above it:
nplookup = news_page('template.html').lookup
@
On Jan 18, 8:44 am, Jonathan S wrote:
> Hi all,
> The following is what I want to do, but this results in a syntax
> error:
>
> @news_page('template.html').lookup(News, 'news_id', 'news')
> def view(request, group, news):
> pass
>
> What does work is the equivalent old way of doing decorating:
Hi all,
The following is what I want to do, but this results in a syntax
error:
@news_page('template.html').lookup(News, 'news_id', 'news')
def view(request, group, news):
pass
What does work is the equivalent old way of doing decorating:
def view(request, group, news):
pass
view = ne
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
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,
parent property, rather than calling the property
directly.
Is it possible to rewrite this property using decorator syntax? Does the
@property decorator create some underlying method that I can call directly?
Alternately, perhaps there is a way to rewrite the recursion so that such a
call is
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
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
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
18 matches
Mail list logo