Yes, in the for in contex, both do the same.

But it's not the same:
arrays is a list object.
arrays[:] are all the element in the list.

If you want to remove every object in the list you can do:

del arrays[:]

If you want to remove the list object (not objects in it):

del arrays

Don't know if it's clear. :)

Regards,

Dorian




________________________________
 De : Panupat Chongstitwattana <[email protected]>
À : [email protected] 
Envoyé le : Vendredi 1 mars 2013 17h33
Objet : [Maya-Python] what does list[:] do ?
 

for a in arrays:
and
for a in arrays[:]:
seem to do exactly the same thing. Is there any difference made by the [:] ?
-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to