Re:Why does `True == False is False` evaluate to False in Py...
by epistasis on Friday May 01, 2020 @11:23PM
(#23048875)
I could see this for something like
But chaining the == with other operators feels weird, especially "is". Similarly
feels very off to me, and I'm not sure it should be chainable. If the intuition is to emulate human notation in math, there are many chained expressions that we would not allow to happen.
[ Parent
| on HN ]
Re:Why does `True == False is False` evaluate to False in Py...
by marcosdumay on Saturday May 02, 2020 @12:09AM
(#23049096)
> But chaining the == with other operators feels weird
Chaining anything with `is` feels weird to me, but:
foo >= bar == baz >= fooo
fells perfectly ok.
Re:Why does `True == False is False` evaluate to False in Py...
by throwaway_pdp09 on Saturday May 02, 2020 @05:21AM
(#23050512)
(please ignore, I'm an idiot)
(deleted)
Re:Why does `True == False is False` evaluate to False in Py...
by baq on Saturday May 02, 2020 @05:35AM
(#23050568)
Not OP but Iād expect no precedence as I expect this to parse into a series of number comparisons and-chained.
Re:Why does `True == False is False` evaluate to False in Py...
by throwaway_pdp09 on Saturday May 02, 2020 @06:21AM
(#23050794)
Damn, you're right, was being stupid. Duh.