Is this valid ?
sjmachin at lexicon.net
Wed Mar 19 22:51:15 CET 2008
On Mar 20, 8:18 am, Stef Mientki <stef.mien... at gmail.com> wrote:
> 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
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".
More information about the Python-list