string issue
Steve Holden
steve at holdenweb.com
Fri Feb 4 17:18:41 EST 2005
Terry Reedy wrote:
> "Steve Holden" <steve at holdenweb.com> wrote in message
> news:36QMd.103084$Jk5.36127 at lakeread01...
>
[ ... ]
>
> 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/
More information about the Python-list
mailing list