True == 1 weirdness

Steven D'Aprano steve at
Thu Sep 17 03:16:25 CEST 2015

On Thu, 17 Sep 2015 03:44 am, Grant Edwards wrote:

> On 2015-09-16, Steven D'Aprano <steve at> wrote:
>> On Thu, 17 Sep 2015 03:27 am, Grant Edwards wrote:
>>> On 2015-09-16, Sven R. Kunze <srkunze at> wrote:
>>>> On 16.09.2015 18:57, Random832 wrote:
>>>>> I think that chaining should be limited to:
>>>>> A) all operators are "="
>>>>> B) all operators are "is"
>> [...]
>>> I'm not all that sure A and B should be allowed.
>> You can take `x == y == z` off me when you pry it from my cold, dead
>> hands.
> Well, that case hadn't been mentioned yet. But, I agree that should be
> added as case E and be allowed.

I assumed that since we were talking about *operators* and *comparisons*,
Random832 had merely typoed "=" when (s)he meant "==", since assignment =
is neither an operator nor a comparison.

But while we're at it, you can also take away chained assignments over my
dead body -- and even then, I'll probably come back from the grave as
vengeful spirit to wreck bloody retribution on all those responsible.


More information about the Python-list mailing list