Re: kw param question

2009-08-04 Thread kj
In Steven D'Aprano writes: >On Mon, 03 Aug 2009 19:59:23 +, kj wrote: >> I want to write a decorator that, among other things, returns a function >> that has one additional keyword parameter, say foo=None. >> >> When I try >> >> def my_decorator(f): >> # blah, blah >> def wrapper

Re: kw param question

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 19:59:23 +, kj wrote: > I want to write a decorator that, among other things, returns a function > that has one additional keyword parameter, say foo=None. > > When I try > > def my_decorator(f): > # blah, blah > def wrapper(*p, foo=None, **kw): > x = f(*p

Re: kw param question

2009-08-03 Thread kj
In Albert Hopkins writes: >On Mon, 2009-08-03 at 19:59 +, kj wrote: >> >> I want to write a decorator that, among other things, returns a >> function that has one additional keyword parameter, say foo=None. >> >> When I try >> >> def my_decorator(f): >> # blah, blah >> def wrappe

Re: kw param question

2009-08-03 Thread Albert Hopkins
On Mon, 2009-08-03 at 19:59 +, kj wrote: > > I want to write a decorator that, among other things, returns a > function that has one additional keyword parameter, say foo=None. > > When I try > > def my_decorator(f): > # blah, blah > def wrapper(*p, foo=None, **kw): > x = f(*

kw param question

2009-08-03 Thread kj
I want to write a decorator that, among other things, returns a function that has one additional keyword parameter, say foo=None. When I try def my_decorator(f): # blah, blah def wrapper(*p, foo=None, **kw): x = f(*p, **kw) if (foo): # blah, blah else