"Matko" <ivastipan...@inet.hr> 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-valued integer objects; it then makes
uv_face_mapping be a name for this list.

(This is therefore not the same as

        uv_face_mapping = [[0, 0, 0, 0]] * len(faces)

which constructs a list, each of whose elements is (well, refers to) the
/same/ list of four zero-valued integers.)

-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to