1. Think about it. The first case will make a new list and copy "size"
*objects. When the assignment happens, the old list has its reference
count decremented. Not very memory-friendly. The second case merely
truncates the existing list in situ. Bit hard to imagine how the first
case could ever be faster than the second case. You might like to read
the source code. The file that you are looking for is listobject.c.
2. Measure it.
3. Unless you are deliberately parodying [EMAIL PROTECTED], don't use
"L".lower() as a variable name.
4. Try reading this list / newsgroup more often -- (a) this topic (or a
closely related one) was covered within the last week or so (b) you
might notice abuse like (3) above being hurled at others and avoid
copping your share.
HTH,
John

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to