Terry Reedy wrote:
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[ ... ]
This seems much more sensible to me than building a new list with
everything (a copy), including things you don't want, and then deleting the
things you don't want (an O(n**2) operation).
Which is presumably why the OP decided to go with the list
comprehension. My main intention was to point out how the code in error
could be fixed while retaining the same structure. You are of course
correct in saying this is far from optimal in performance terms.
regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/
--
http://mail.python.org/mailman/listinfo/python-list