Using multiple "*"-style arguments

Andrew Koenig ark at acm.org
Fri Jun 18 17:19:40 CEST 2004


> > Does this do what you want?
> >
> >     x = struct.pack((">HhhhhhhHHHL", i, *(bounds + b[0:2] + b[6:9] +
> > [len(s)]))
>
> No, unfortunately, because the arguments in the bounds and b lists are
> numeric, so adding them isn't the right thing.

Have you tried it?  b[0:2] is a list, so + means concatenation, not
addition.





More information about the Python-list mailing list