On Fri, 06 Aug 2010 15:37:04 +0200, Stefan Schwarzer wrote: >> Plus, I believe the >> "==" operator will check if the variables point to the same object. > > No, that's what `is` is for.
Actually, yes, equality is implemented with a short-cut that checks for identity first. That makes something like: s = "abc"*1000*1000*10 s == s nice and quick, as Python can immediately recognise that a string is always equal to itself without having to walk the entire string comparing each character with itself. -- Steven -- http://mail.python.org/mailman/listinfo/python-list