True == 1 weirdness

Mark Lawrence breamoreboy at yahoo.co.uk
Wed Sep 16 22:17:44 CEST 2015


On 16/09/2015 17:16, Marko Rauhamaa wrote:
> Chris Angelico <rosuav at gmail.com>:
>
>> Far as I can see, the only operator that you might want to disallow
>> chaining on is 'in' (and its mate 'not in', of course). It isn't
>> common, but "x is y is z is None" is a perfectly reasonable way to
>> ascertain whether or not they're all None, just as "x = y = z = None"
>> is a perfectly reasonable way to set them all to None;
>
> Then you can have:
>
>     first_node is not node is not last_node
>
> No, seriously, that's not reasonable.
>
> Frankly, I don't think chaining was all that great of an idea.
>
>
> Marko
>

I disagree, perfectly logical where I sit.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Python-list mailing list