What you've happened across is called operator chaining.
From the documentation on Comparisons:
Comparisons can be chained arbitrarily, e.g., x < y <= z
is
equivalent to x < y and y <= z
, except that y
is evaluated only once
(but in both cases z
is not evaluated at all when x < y
is found to be
false).
Emphasis mine.
So, this would mean lie is lie is lie
is interpreted as (lie is lie) and (lie is lie)
, and nothing more.
More generally, a op b op c op d ...
is evaluated the same as a op b and b op c and c op d ...
and so on. The expression is parsed according to python's grammar rules. In particular;
comparison ::= or_expr ( comp_operator or_expr )*
comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="
| "is" ["not"] | ["not"] "in"