Replace Several Items
Fredrik Lundh
fredrik at pythonware.com
Wed Aug 13 18:31:00 EDT 2008
Wojtek Walczak wrote:
>> suggested exercise: benchmark re.sub with literal replacement, re.sub
>> with callback (lambda m: ""), repeated replace, and repeated use of the form
>>
>> if ch in my_string:
>> my_string = my_string.replace(ch, "")
>>
>> on representative data.
>
> I don't have to, I can anticipate the results.
Chances are that you're wrong.
</F>
More information about the Python-list
mailing list