>I find I am still left asking the question "why would anyone want to do
>that?".
You didn't say which part you were referring too. As far as wrapping
the same exact wrapper more than once. You probably wouldn't do that.
It's just easier to test the use of multiple wrappers that way.
As far as
Guess I am listening to language funny today.
Steve Holden wrote:
By the way, we pass *parameters* to functions, *perimeters* surround
things.
But we do pass parameters *around*, which may be the source of the
confusion. :-)
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/
Ron_Adam wrote:
On Wed, 06 Apr 2005 08:10:22 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
I don't understand your seeming fixation with wrappers and wrapping.
Fixated implies, I'm stuck on a single thing, but I'm not. I am
learning as I go, and exploring some possibilities as well. :-)
That's
On Wed, 06 Apr 2005 08:10:22 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
>I don't understand your seeming fixation with wrappers and wrapping.
Fixated implies, I'm stuck on a single thing, but I'm not. I am
learning as I go, and exploring some possibilities as well. :-)
> That's not
>the only
Bengt Richter wrote:
@deco.one
> def foo(): pass
Ok, now what do you call this @-line? Freaky decorator factory invocation?
Decoratoriferous expression? ;-)
This one has a certain je ne sais quoi ;-), but I'd call "deco.one"
the decorator function (since it _must_ evaluate to a function), and
if i
Bengt Richter wrote:
> On 5 Apr 2005 19:28:55 -0700, "El Pitonero" <[EMAIL PROTECTED]>
wrote:
>
> >Scott David Daniels wrote:
> >> Ron_Adam wrote:
> >> > ...
> >>
> >> def tweakdoc(name):
> >> def decorator(function):
> >>function.__doc__ = 'Tweak(%s) %r' % (name, function.__d
On Wed, 06 Apr 2005 02:31:05 GMT, Ron_Adam <[EMAIL PROTECTED]> wrote:
>On Tue, 05 Apr 2005 19:38:38 -0400, Steve Holden <[EMAIL PROTECTED]>
>wrote:
>
>
>>>
>>So what you are saying is that you would like to be able to use
>>arbitrarily complex expressions after the :at" sign, as long as they
>>
On 5 Apr 2005 19:28:55 -0700, "El Pitonero" <[EMAIL PROTECTED]> wrote:
>Scott David Daniels wrote:
>> Ron_Adam wrote:
>> > ...
>>
>> def tweakdoc(name):
>> def decorator(function):
>> function.__doc__ = 'Tweak(%s) %r' % (name, function.__doc__)
>> return function
>>
On Wed, 06 Apr 2005 16:33:24 +1200, Greg Ewing
<[EMAIL PROTECTED]> wrote:
>Ron_Adam wrote:
>> I would have preferred the @ symbol to be used as an inline assert
>> introducer. Which would have allowed us to put debug code anywhere we
>> need. Such as @print total @.
>
>Don't lose heart, there
Ron_Adam wrote:
I would have preferred the @ symbol to be used as an inline assert
introducer. Which would have allowed us to put debug code anywhere we
need. Such as @print total @.
Don't lose heart, there are still two unused characters
left, $ and ?.
? might even be more mnemonic for this pu
On Tue, 05 Apr 2005 19:38:38 -0400, Steve Holden <[EMAIL PROTECTED]>
wrote:
>>
>So what you are saying is that you would like to be able to use
>arbitrarily complex expressions after the :at" sign, as long as they
>return a decorator? If so, you've been "pronounced" :-)
>
>regards
> Steve
No
Scott David Daniels wrote:
> Ron_Adam wrote:
> > ...
>
> def tweakdoc(name):
> def decorator(function):
> function.__doc__ = 'Tweak(%s) %r' % (name, function.__doc__)
> return function
> return decorator
>
> What is confusing us about what you write is tha
Ron_Adam wrote:
On Tue, 05 Apr 2005 02:55:35 -0400, Steve Holden <[EMAIL PROTECTED]>
wrote:
Ron_Adam wrote:
Ok, that post may have a few(dozen?) problems in it. I got glitched
by idles not clearing variables between runs, so it worked for me
because it was getting values from a previous run.
This
On Tue, 05 Apr 2005 14:32:59 -0700, Scott David Daniels
<[EMAIL PROTECTED]> wrote:
>Ron_Adam wrote:
>> What I was referring to is the case:
>> @decorator(x,y,z)
>> As being a decorator expression with more than one argument.
>But, we generally say this is a call to a function named decorato
Ron_Adam wrote:
What I was referring to is the case:
@decorator(x,y,z)
As being a decorator expression with more than one argument.
But, we generally say this is a call to a function named decorator
that returns a decorator. If you called it:
@make_decorator(x,y)
def .
We'd be s
On Tue, 05 Apr 2005 02:55:35 -0400, Steve Holden <[EMAIL PROTECTED]>
wrote:
>Ron_Adam wrote:
>> Ok, that post may have a few(dozen?) problems in it. I got glitched
>> by idles not clearing variables between runs, so it worked for me
>> because it was getting values from a previous run.
>>
>> Thi
Bengt Richter wrote:
> From the 2.4 Grammar, the key part seems to be
>
> decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
> decorators: decorator+
> funcdef: [decorators] 'def' NAME parameters ':' suite
>
> and further on
>
> dotted_name: NAME ('.' NAME)*
>
> So the Python
Bengt Richter wrote:
> From the 2.4 Grammar, the key part seems to be
>
> decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
> decorators: decorator+
> funcdef: [decorators] 'def' NAME parameters ':' suite
>
> and further on
>
> dotted_name: NAME ('.' NAME)*
>
> So the Python
On 5 Apr 2005 00:54:25 -0700, "Kay Schluehr" <[EMAIL PROTECTED]> wrote:
>Steve Holden wrote:
>
>> You have several times mentioned the possibility of a decorator
>taking
>> more than one argument, but in my understanding of decorators this
>just
>> wouldn't make sense. A decorator should (shouldn'
Steve Holden wrote:
> You have several times mentioned the possibility of a decorator
taking
> more than one argument, but in my understanding of decorators this
just
> wouldn't make sense. A decorator should (shouldn't it) take precisely
> one argument (a function or a method) and return precise
Ron_Adam wrote:
Ok, that post may have a few(dozen?) problems in it. I got glitched
by idles not clearing variables between runs, so it worked for me
because it was getting values from a previous run.
This should work better, fixed a few things, too.
The decorators can now take more than one argu
Ok, that post may have a few(dozen?) problems in it. I got glitched
by idles not clearing variables between runs, so it worked for me
because it was getting values from a previous run.
This should work better, fixed a few things, too.
The decorators can now take more than one argument.
The fun
Hi, Thanks again for all the helping me understand the details of
decorators.
I put together a class to create decorators that could make them a lot
easier to use.
It still has a few glitches in it that needs to be addressed.
(1) The test for the 'function' object needs to not test for a s
23 matches
Mail list logo