"Ron Adam" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> To avoid that you either need to define the flag string as a global name
> or use it strictly in the local scope it's defined in.  Python will also
> sometimes reuse strings as an optimization instead of creating a second
> string if they are equal.  Something else to be aware of.

I believe CPython's string equality function first checks the two strings 
for identity.  So one gets most of the benefit of 'is' testing anyway.  (An 
I presume it next check for length equality.)

tjr 



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

Reply via email to