for , ordering

Andrew Koenig ark at research.att.com
Thu Jun 6 19:14:24 CEST 2002


gabor> hi,
gabor> i have a list and i want to create a copy of it with a bit different
gabor> objects... by now i have something like this:

gabor> objects1 = []
gabor> objects2 = []
gabor> .
gabor> .
gabor> .

gabor> for obj1 in objects1:
gabor> 	objects2.append(obj2(obj1.x))


gabor> 1. isn't there a more elegant way to do this?

Isn't this the same as saying

        objects2 = objects1[:]

?  Am I missing something obvious?

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list