Re: siple for in expression

2009-03-05 Thread Matko
Thanks everyone! Matko ;) Thanks "Matko" wrote in message news:gojkfo$2p...@gregory.bnet.hr... > Hello! > > Can someone help me to understand the following code: > > uv_face_mapping = [[0,0,0,0] for f in faces] > > Thank You very much! > > Matko from Croatia > -- http://mail.python.org/mailm

Re: siple for in expression

2009-03-03 Thread alex23
On Mar 4, 2:05 am, "Matko" wrote: > Can someone help me to understand the following code: > uv_face_mapping = [[0,0,0,0] for f in faces] As others have mentioned, this is a list comprehension, which is a simpler way of writing the following: uv_face_mapping = [] for f in faces: uv_face_m

Re: siple for in expression

2009-03-03 Thread Mark Wooding
"Matko" writes: > Can someone help me to understand the following code: > > uv_face_mapping = [[0,0,0,0] for f in faces] It constructs a fresh list, with the same number of elements as are in the iterable object referred to by `faces', and where each element is a distinct list of four zero-value

Re: siple for in expression

2009-03-03 Thread Mike Driscoll
On Mar 3, 10:05 am, "Matko" wrote: > Hello! > > Can someone help me to understand the following code: > > uv_face_mapping = [[0,0,0,0] for f in faces] > > Thank You very much! > > Matko from Croatia That looks like a list comprehension. It basically creates a list by iterating over some kind of c