Josiah Carlson wrote:
... I try to limit my use of decorators whenever possible, both because I
still have to support Python 2.3 (which doesn't support the syntax), and
because I find that they obfuscate what the code is doing more often
than not. I will admit that they are useful as a metapro
james_027 wrote:
> hi bruno,
>
> That seems to be hard to read at all, or I am just very new to python?
No, it's hard to read. Note that it's not, technically, necessary to
use nested functions to get the same results as a particular decorator.
For example, earlier you provided...
def check
On Jul 23, 11:25 am, Jason <[EMAIL PROTECTED]> wrote:
> On Jul 23, 2:13 am, james_027 <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I am learning python by learning django, and I stumble upon decorator
> > which is very cool, any beginners resources for python decorators,
> > although I can google it,
james_027 wrote:
> Hi,
>
>>> def check_login(func):
>>> def _check_login(*args):
>>> print "I am decorator"
>>> return func(*args)
>>> return _check_login
>>> @check_login
>>> def method2(input):
>>> print "I am method TWO. Input %s" % input
>> That looks okay. What is
On Jul 23, 2:13 am, james_027 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am learning python by learning django, and I stumble upon decorator
> which is very cool, any beginners resources for python decorators,
> although I can google it, I just want to get a good tutorial for this
> topic.
>
> Thanks
>
james_027 a écrit :
> hi bruno,
>
> That seems to be hard to read at all, or I am just very new to python?
or just new to higher order functions ? (ie: functions working on
functions).
> With that decorator how do I take advantage of it compare when I just
> write a function that could do the s
james_027 wrote:
> hi bruno,
>
> That seems to be hard to read at all, or I am just very new to python?
>
> With that decorator how do I take advantage of it compare when I just
> write a function that could do the same as what the decorator did? I
> could translate the could from above into ...
Hi,
> > def check_login(func):
> > def _check_login(*args):
> > print "I am decorator"
> > return func(*args)
> > return _check_login
>
> > @check_login
> > def method2(input):
> > print "I am method TWO. Input %s" % input
>
> That looks okay. What is unclear?
>
It jus
james_027 <[EMAIL PROTECTED]> writes:
> Hi all,
(Please don't top-post your reply. Instead, remove from the quoted
material all the parts that are irrelevant to your reply, and post
underneath what you're responding to, in normal chronological order
like any other discussion.)
> I am having diff
hi bruno,
That seems to be hard to read at all, or I am just very new to python?
With that decorator how do I take advantage of it compare when I just
write a function that could do the same as what the decorator did? I
could translate the could from above into ...
def check_login(msg):
#...
Hi all,
I am having difficulty understanding decorator. The definition was
clear for me, but the syntax is not so clear to me.
will decorators will always have to be in this way
def check_login(func):
def _check_login(*args):
print "I am decorator"
return func(*args)
retu
james_027 a écrit :
> Hi all,
>
> I am having difficulty understanding decorator. The definition was
> clear for me, but the syntax is not so clear to me.
>
> will decorators will always have to be in this way
>
> def check_login(func):
> def _check_login(*args):
> print "I am decora
james_027 schreef:
> Hi,
>
> I am learning python by learning django, and I stumble upon decorator
> which is very cool, any beginners resources for python decorators,
> although I can google it, I just want to get a good tutorial for this
> topic.
I like the short explanation on Kent's Korner:
james_027 wrote:
> Hi,
>
> I am learning python by learning django, and I stumble upon decorator
> which is very cool, any beginners resources for python decorators,
> although I can google it, I just want to get a good tutorial for this
> topic.
Decorators are just a more concise but less obvious
On Jul 23, 10:13 am, james_027 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am learning python by learning django, and I stumble upon decorator
> which is very cool, any beginners resources for python decorators,
> although I can google it, I just want to get a good tutorial for this
> topic.
>
> Thanks
james_027 a écrit :
> Hi,
>
> I am learning python by learning django, and I stumble upon decorator
> which is very cool, any beginners resources for python decorators,
> although I can google it, I just want to get a good tutorial for this
> topic.
You should find answers on python.org, and sear
Hi,
I am learning python by learning django, and I stumble upon decorator
which is very cool, any beginners resources for python decorators,
although I can google it, I just want to get a good tutorial for this
topic.
Thanks
james
--
http://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo