[swift-evolution] Proposal: Python's multiple comparisons and multiple assignments

Sune Foldager cyano at me.com
Thu Dec 17 12:49:33 CST 2015


Hmm, I don’t think it’s worth the added complexity that it will surely result in. Also, for non-standard operators it’s hard to see how it would be evaluated. Would:

x op1 y op2 z

Turn into:

(x op1 y) && (y op2 z)

for boolean-returning operators? I guess that could make sense, but I’m not sure I like the syntax much. I think it looks ok for x < y < z, but otherwise it gets confusing.

-Sune

> On 17 Dec 2015, at 19:44, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Some Python examples:
> 
> if 2 < 3 < 4 == 4 <= 5 { … }
> 
> a = b = c = 1



More information about the swift-evolution mailing list