"skull" wrote:

> It makes a copy operation!

so?  in python, shallow copies are cheap.

> here is a faster and 'ugly' solution:

faster?  did you try it, or are you combining a C++ mindset with an
urge to do premature optimizations?  (hint: it's slower)

if you care about performance, you shouldn't use "remove", btw.  building
a new list is more efficient, especially if you use a list comprehension:

    lst = [i for i in lst if i != 2]

(if you have 2.4, try replacing [] with () and see what happens)

</F> 



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

Reply via email to