Re: Unpacking sequences and keywords in one function call

2006-11-14 Thread OKB (not okblacke)
Dennis Lee Bieber wrote: > On Tue, 14 Nov 2006 05:45:57 GMT, "OKB (not okblacke)" > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> I was just wondering about this yesterday. Is there a >> reason you >> can only unpack a sequence at the END of t

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread OKB (not okblacke)
Steve Holden wrote: > Noah Rawlins wrote: > You should be ok as long as you use the following ordering of > actual arguments in a function call: > >1. Positional arguments >2. Keyword arguments >3. * sequence >4. ** dict I was just wondering about this yesterday. Is ther

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Steve Holden
Noah Rawlins wrote: > ram wrote: >> Stupid question #983098403: >> >> I can't seem to pass an unpacked sequence and keyword arguments to a >> function at the same time. What am I doing wrong? >> >> def f(*args, **kw): >> for a in args: >> print 'arg:', a >> for (k,v) in kw.iteritems

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 22:06, ram wrote: Stupid question #983098403: I can't seem to pass an unpacked sequence and keyword arguments to a function at the same time. What am I doing wrong? def f(*args, **kw): for a in args: print 'arg:', a for (k,v) in kw.iteritems(): pri

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Noah Rawlins
ram wrote: > Stupid question #983098403: > > I can't seem to pass an unpacked sequence and keyword arguments to a > function at the same time. What am I doing wrong? > > def f(*args, **kw): > for a in args: > print 'arg:', a > for (k,v) in kw.iteritems(): > print k, '=', v

Unpacking sequences and keywords in one function call

2006-11-13 Thread ram
Stupid question #983098403: I can't seem to pass an unpacked sequence and keyword arguments to a function at the same time. What am I doing wrong? def f(*args, **kw): for a in args: print 'arg:', a for (k,v) in kw.iteritems(): print k, '=', v >>> f(1,2) arg: 1 arg: 2 >>>