[swift-evolution] Proposal: Python's "in" and "not in" syntactic sugar

Krzysztof Siejkowski krzysztof at siejkowski.net
Thu Dec 17 09:07:59 CST 2015

Most programmers would probably love using them though.

Myself, I’d not love using them. I also don’t like them in Python.

But not to dismiss the idea on personal merits, could you please elaborate on the details of „in” and „not in” usage?

1) What types could they be used with? SequenceType? Array? Dictionary? Set? Optional? 

2) Should their usage be extensible to any type? Will there be a possibility for a type Foo to participate in? 


let foo = Foo()

if bar in foo {}

if bar not in foo {}


3) Will the operators be usable only in `if` statement? What about case, where clauses etc?


> -- 
> Brent Royal-Gordon
> Architechies

swift-evolution mailing list
swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151217/4a133987/attachment-0001.html>

More information about the swift-evolution mailing list