Roy Smith wrote: > One may be marginally faster, but they both require copying the source > string, and are thus both O(n).
Sorry, I'm not familiar with the O(n) notation. > If you're just doing one or a small fixed > number of these, it really doesn't matter. Pick whichever one you think is > easier to read. Thanks guys. I have a handful of methods that each do this task once per call, so I suppose this counts as not a lot, at least not at one time. And it seems like a good point that the real problem could be constantly concatenating with self.source, rather than the smaller pieces being put together. -- http://mail.python.org/mailman/listinfo/python-list