[Tutor] what is the * operator called in this context?

bill nieuwendorp slow67 at gmail.com
Sun Jul 29 23:37:32 CEST 2007


when ever I need to use the struct module
I always store my values in a list or a dict, then
I do something like the code below

import struct
list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
length =len(list)
struct.pack(">%di"%(length), *[i for i in list])

now I can not remember where I came up with that,
I thought I read it in the python docs somewhere
but I can not find any mention of it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070729/b5822b76/attachment.html 


More information about the Tutor mailing list