Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'argument': 0.05; 'subject:Python3': 0.09; 'python': 0.11; '__lt__': 0.16; 'does);': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'negation': 0.16; 'rather,': 0.16; 'subject:doc': 0.16; 'wrote:': 0.18; "shouldn't": 0.24; 'mon,': 0.24; 'versions': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'charset:windows-1252': 0.65; 'reflection': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=yNmQVezn6EznSW+XIsAS1PDy6nCiA2ii9aqpxToVlVA=; b=iA7v89zODXLLOUp7y+P/ov1Z5yp3uxrhs2GdoE0kLlcaWbVhDmSNwnuC0+mP1lV94P RkrxDDPUt2vNAtOW0I/FzCh0khpv8My+PEPZf9oAnaHfrcc6O5YFFcQYVL848K04zm3u 0amNt09B0SukfePhaIzZdWlavoIk+HbTcFF7UWAY+s0HmwCfVwNU9x6YtJQZBzWMsk4o cCIrpMVtpF6ZyM+jqRt7Xjar6W2QXFW7qNsdct+EePab0t6zurkLKgWiTW6awKTN2k7x b2uGdX1AQgSk/Bjj2+rVt4Z46XS2bSzmVct6w9P/ALDp/OjEQ/U3Xepc67NDdMjg7ZI1 knGw== MIME-Version: 1.0 X-Received: by 10.66.122.66 with SMTP id lq2mr1215170pab.183.1382963012348; Mon, 28 Oct 2013 05:23:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Oct 2013 23:23:32 +1100 Subject: Re: Python3 doc, operator reflection From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382963021 news.xs4all.nl 16001 [2001:888:2000:d::a6]:46692 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57813 On Mon, Oct 28, 2013 at 11:00 PM, Johannes Bauer wro= te: >> There are no swapped-argument versions of these methods (to be used when= the left argument does not support the operation but the right argument do= es); rather, __lt__() and __gt__() are each other=92s reflection, __le__() = and __ge__() are each other=92s reflection, and __eq__() and __ne__() are t= heir own reflection. > > But shouldn't __lt__ be the reflection or __ge__ and __gt__ the > reflection of __le__? lt is the negation of ge, but it's the reflection of gt. Consider this: 1 < 2 2 > 1 If Python can't ask 1 if it's less than 2, it'll ask 2 if it's greater than= 1. ChrisA