Path: csiph.com!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'operator': 0.03; 'received:internal': 0.09; 'semantics': 0.09; '"this': 0.13; 'wed,': 0.15; '"in"': 0.16; 'disallow': 0.16; 'distinction': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'op1': 0.16; 'op2': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'semantically': 0.16; 'wrote:': 0.16; 'fairly': 0.22; 'meant': 0.22; 'not,': 0.22; 'sep': 0.22; 'simpler': 0.22; 'header:In- Reply-To:1': 0.24; 'all.': 0.24; 'chris': 0.26; 'comparison': 0.29; 'once.': 0.29; 'operators': 0.29; 'types.': 0.29; 'objects': 0.29; 'probably': 0.31; 'int': 0.33; 'rule': 0.33; 'similar': 0.33; 'definition': 0.34; 'quite': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'things': 0.38; 'received:66': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'relationship': 0.61; 'header :Message-Id:1': 0.61; 'different': 0.63; 'between': 0.65; 'subject:True': 0.93 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=4fW8O0iHSMtd8SIeEHrvCYwf0oE=; b=F+t3l0 aeJQZk7N8YRwEF41J41/RBQfOwm1zVFX+adwHBckECG76VGUOVE6NqYnT/s6mtvx JeM9e3w0oDKwO6ojIqa59tUkiPqv+H8PtxSu6mDPc8rPv0gHgHVl04X17kDw7Ab3 FGHwM4vTsrFIebJoMZMoEWnVqrFCxEPw19+ys= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=4fW8O0iHSMtd8SI eEHrvCYwf0oE=; b=kkODSy82ekJuRtreC8VZc++X4IuBb9vGPHYfKSzalTtCPCk gCmCyTYHC+gbuMzoT9CCn5IqUkV9ceAzU7qlgQ84RlCp+xAkqQb+qrKqOJLXvILl szsjEz78aEo6P/Ch4sfqHUb/1zYhI7RAL4wZrrsaITNgrhNUHfHHwIOG2uy8= X-Sasl-Enc: PrwNfC/TZ+GeanjptPuiwHRrVudQvbynlBcoJ9udEvx2 1442418044 From: Random832 To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-746d2121 Subject: Re: True == 1 weirdness Date: Wed, 16 Sep 2015 11:40:44 -0400 In-Reply-To: References: <0b949fe0-09b4-46b0-b4ac-a85a9bfebfd5@googlegroups.com> <1442412230.1762717.385286049.20841F36@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442418047 news.xs4all.nl 23813 [2001:888:2000:d::a6]:34491 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96687 On Wed, Sep 16, 2015, at 10:26, Chris Angelico wrote: > Quite probably never. But are there _any_ comparison operators which > are unchainable? If not, there's no reason to disallow 'in' "in" suggests a relationship between objects of different types (X and "something that can contain X") - all the other comparison operators are meant to work on objects of the same or similar types. Why not make isinstance a comparison operator and have "1 instanceof int instanceof type"? Having chaining apply to things that are not *semantically* comparisons is just baffling. >; this is > the distinction between language-level features and usage > recommendations. All comparisons can be chained, and the semantics of > (X op1 Y op2 Z) will always be ((X op1 Y) and (Y op2 Z)) but with Y > evaluated only once. That definition is fairly simple, and even though > it's a little wordy, it makes perfect sense; and the rule "all > comparisons" is way WAY simpler than "this specific set of chainable > operators", It's the same thing - you've just named that set "comparisons". I don't think "in" is semantically a comparison at all.