On Wed, 27 Dec 2006 02:52:42 -0800, John Machin wrote:

> 
> Duncan Booth wrote:
>> "John Machin" <[EMAIL PROTECTED]> wrote:
>>
>> > To compare two strings, take copies, and:
>>
>> Taking a copy of a string seems kind of superfluous in Python.
> 
> You are right, I really meant don't do:
>     original = original.strip().replace(....).replace(....)
> (a strange way of doing things which I see occasionally in other folks'
> code)

Well, sure it is strange if you call the variable "original". But if you
don't care about the original, what's so strange about writing this?

astring = astring.strip().replace(....).replace(....)

Why keep the original value of astring around if you no longer need it?


-- 
Steven.

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

Reply via email to