Paul McGuire <[EMAIL PROTECTED]> writes: > On May 20, 10:17 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: [...] >> <split hairs> >> Isn't >> >> c not in seen and (seen.add(c) or True) >> >> the same as >> >> seen.add(c) or c not in seen >> >> ? >> >> > return ''.join(new) >> >> (notice I haven't closed the tag!) >> >> -- >> Arnaud- Hide quoted text - >> >> - Show quoted text - > > Unfortunately, no. "seen.add(c) or c not in seen" will never return > true, since c gets added to seen before testing if c in seen. > > -- Paul
Ha you're right of course. But I haven't closed the tag yet, so: c not in seen and (seen.add(c) or True) is definitely the same as c not in seen and not seen.add(c) which is not (c in seen or seen.add(c)) :) </split hairs> -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list