<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 25, 2010, at 2:32 PM, Michael Foord wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; "><div class="im"><br><br></div>x = y in z # where x is a non boolean.<br><br>Yuck.<br><br></blockquote><div><br><br>How is it any worse than:<br><br><br> x = y > z # where x is a non boolean<br><br>And all the other operators that already do this?<br></div></div></blockquote><div><br></div><div><br></div><div>Terrible sales technique: "how is this any worse than ..." ;-)</div><div><br></div><div>Other operations such as rich comparisons have</div><div>complicated our lives but had sufficient offsetting benefits</div><div>than made them more bearable. Rich comparisons cause</div><div>no end of trouble but at least they allow the numeric folks</div><div>to implement some well studied behaviors than have proven</div><div>benefits in their domain.</div><div><br></div><div>In contrast, this proposal offers almost zero benefit to offset</div><div>the pain it will cause. The OP didn't even offer a compelling</div><div>use case or a single piece of code that wouldn't be better</div><div>written with a normal method.</div><div><br></div><div>No existing code expects "in" to return a non-boolean.</div><div>A lot of code for containers or that uses containers implicitly</div><div>expects simple invariants to hold:</div><div><br></div><div> for x in container:</div><div> assert x in container</div><div><br></div><div><br></div><div><br></div><div>Raymond</div><div><br></div><div><br></div><div>P.S. With rich comparisons, we've lost basics assumptions</div><div>like equality operations being reflexsive, symmetric, and</div><div>transitive. We should be cautioned by that experience</div><div>and only go down that path again if there is a darned good reason.</div></div></body></html>