Path: csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed8.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.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'essentially': 0.04; 'imply': 0.07; 'implies': 0.09; '"=="': 0.16; '"is"': 0.16; 'chained': 0.16; 'elements,': 0.16; 'equivalence': 0.16; 'expression.': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'saying': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'compare': 0.27; 'comparison': 0.29; 'operators': 0.29; 'anywhere': 0.30; 'another': 0.32; 'point': 0.33; 'common': 0.33; 'this?': 0.34; 'received:10.0': 0.34; 'mix': 0.35; 'but': 0.36; 'there': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'really': 0.37; 'being': 0.37; 'thought': 0.37; 'anything': 0.38; 'several': 0.38; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'some': 0.40; 'relationship': 0.61; 'charset:windows-1252': 0.62; 'between': 0.65; 'natural': 0.67; 'aspect.': 0.84; 'loses': 0.84; 'subject:True': 0.93; 'hand,': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1442426248; bh=eSViyD835WH/5LnlSDoVohsIBXoVnh2WkxU69B5i/M4=; h=Subject:To:References:From:Date:In-Reply-To:From; b=zKEDj7JT+ksfSMbnQF4NItUIirGWz92do3Z7+TZcvQpylyOEbOyu2b9aGCNxt48fH xcXhtpge7uAM7nMlwLFXTbKJ6lHjDmkNYDucnnQ9+UULaXp4gEYYLlLMrdgXudxLGv ErhpBJ4+NBHaVA2prWrfqgMWUwqUJLJc8qyLQvko= Subject: Re: True == 1 weirdness To: python-list@python.org References: <0b949fe0-09b4-46b0-b4ac-a85a9bfebfd5@googlegroups.com> <55f9a5e9$0$1643$c3e8da3$5496439d@news.astraweb.com> <1442425012.1812534.385496193.511532C4@webmail.messagingengine.com> From: "Sven R. Kunze" Date: Wed, 16 Sep 2015 19:57:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442425012.1812534.385496193.511532C4@webmail.messagingengine.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1247 X-purgate-ID: 154282::1442426248-000007B2-85AEC554/0/0 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: 1442426250 news.xs4all.nl 23752 [2001:888:2000:d::a6]:38505 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96709 On 16.09.2015 19:36, Random832 wrote: > I just had another thought on *why* the other cases make me so uneasy. > > The reason this is reasonable for simple cases like a > b > c or a < b > <= c is that, in their normal meanings, these operations are transitive. > a > b and b > c implies a > c. a < b and b <= c implies a < c. This is > also a good reason for allowing "==" or "is" anywhere - because it's a > natural way to write a graph including an equivalence class: a < b == c > < d implies b < d, a < c, and a < d. So it's a natural way of writing > it. On the other hand, a in b in c doesn't imply a in c for several > common cases, and a > b < c doesn't imply anything about the > relationship between a and c, so it really shouldn't be a single > expression. > > A chained comparison doesn't *actually* compare non-adjacent elements, > but with well-defined transitive relationships (or... semi-transitive? > is there a word for this? My point being that when you include some == > or mix <= and < together, it still allows you to make some statements > about their relationships), you are essentially saying "a, b, c are > ordered". The generalization to mixing arbitrary operators loses this > aspect. Well said!