building lists of dictionaries

Ernesto García García titogarcia_nospamplease_ at gmail.com
Sun Jul 23 11:44:26 EDT 2006


> parinfo = [{'value':0., 'fixed':0, 'limited':[0,0], 'limits':[0.,0.]}]*6

With this, you are creating a list with 6 references to the same list. 
Note that the left operand of '*' is evaluated only once before 
"multiplying" it six times.

Regards,
Tito



More information about the Python-list mailing list