[Python-talk] Can I do this?

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Thu Feb 4 17:23:56 EST 2010


Lloyd Kvam <python at venix.com> wrote on 02/03/2010 06:04:09 PM:

> On Wed, 2010-02-03 at 17:07 -0500, bruce.labitt at autoliv.com wrote:
> 
> 
> > funclist = funcs[:p]    # just select the first p functions of func
> > arglist  = args1[:p]    # likewise the first p args to feed to the 
> > corresponding function
> (Not needed)
> 
> > for bb, func, argn in zip( range(p), funcs, argsl):
> range(p) terminates the zip if p is less than the len of funcs and argsl

I didn't know that.  I can use that!

> 
> >         idx = bb
> leave idx out of the args

Good idea!  Thanks for pointing that out. 

Things can be obvious once pointed out...


> 
> >         WW[bb,:] = func( *argn )
>         ^^^^ I assume that syntax works with your complex array
> WW[bb,:] = func( bb, *argn)
> add the loop index directly into the function call

That is what I ended up doing.  Thanks for the tip!

Bruce

******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************


More information about the Python-talk mailing list