On Mar 20, 8:18 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 >
Of course. You can chain comparisons as much as you like and is (semi-)sensible, e.g. assert 0 < thing_index < thing_count <= UTTER_MAX_NTHINGS There was an interesting use of chained comparison within the last day or 2 in a thread about deriving a set of duplicated list elements -- look for subject == "finding items that occur more than once in a list" and author == "Arnaud Delobelle". Cheers, John -- http://mail.python.org/mailman/listinfo/python-list