Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45269

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'operator': 0.03; 'explicit': 0.07; 'subject:bug': 0.07; 'adopted': 0.09; 'ambiguity': 0.09; 'lawrence': 0.09; 'statements': 0.09; 'worked.': 0.09; 'python': 0.11; '__lt__': 0.16; 'call?': 0.16; 'guess.': 0.16; 'insisted': 0.16; 'languages)': 0.16; 'ought': 0.16; 'python3.': 0.16; 'received:74.208.4.195': 0.16; 'silly': 0.16; 'subject:python3': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'comfortable': 0.22; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'header:In-Reply-To:1': 0.27; 'lines': 0.31; '+0100,': 0.31; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'doing': 0.36; "didn't": 0.36; 'possible': 0.36; 'should': 0.36; 'clear': 0.37; 'to:addr :python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; 'most': 0.60; 'personal': 0.63; 'myself': 0.63; 'face': 0.64; 'stand': 0.64; 'more': 0.64; 'charset:windows-1252': 0.65; 'received:74.208': 0.68; 'special': 0.74; 'beats': 0.84; 'zen': 0.84; 'refuse': 0.93; '2013': 0.98
Date Mon, 13 May 2013 19:22:24 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]
References <mailman.1603.1368401007.3114.python-list@python.org> <HP2kt.66723$Tl3.12499@fx29.fr7> <CAA=1kxSJXn1_Y=oy_oxvL+mUtsZvS+FGoy-vZ39OWpbwDF07dQ@mail.gmail.com> <51912C27.3020809@nedbatchelder.com> <mailman.1641.1368470096.3114.python-list@python.org> <VLckt.68242$kO.37986@fx14.fr7> <kmrqsa$uf3$1@ger.gmane.org>
In-Reply-To <kmrqsa$uf3$1@ger.gmane.org>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Provags-ID V02:K0:ZQv0xSJkAbd6BmHFHS4Igcr4N3CiMyOGA1lKMkozk+b BZK1bhiHkgWhdXxjX+yA7c35x36nNE0POHRYH/t+bkBFsmqX0y Lp37bG92x6YTlwKLtBn3QE+8bTx/Rbjqa+eS0qS+/EiNRWOFMg WqYmPOt6J/01N2ldjgosDpHCtgsvRF/s2APovN+rmSRuMqpiJs E815yjQZCnnLBapxVxtw/DyKV7mz6KUUu+UAM7bcIogEJyFb5Q tcn/W6tG8RtmU6ClpiRV1EMHmXky/f3f5v55Gf3fA1uzt8qOfC IV2+jeEeCzXKyXTe5ni7rH4Jya/9LghmUYqEXJpVOmYSmk7VA= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1647.1368487365.3114.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1368487365 news.xs4all.nl 15993 [2001:888:2000:d::a6]:33886
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45269

Show key headers only | View raw


On 05/13/2013 06:53 PM, Mark Lawrence wrote:
> On 13/05/2013 22:17, Alister wrote:
>> On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote:
>>
>>> I think it is more readable. When doing more complicated statements I
>>> use != instead, but when it's a single test I prefer not … ==
>>>
>>> It's a personal thing. It may also have to do with the fact that I
>>> didn't know python had != when I was a novice.
>>> On 13 May 2013 19:08, "Ned Batchelder" <ned@nedbatchelder.com> wrote:
>>>
>>
>> I would then still write it as not (x == y) to make it clear to myself &
>> avoid any possible confusion although I think that X != Y is much
>> cleaner.
>> 2 lines from the zen stand out here:-
>>
>> Explicit is better than implicit.
>> in the face of ambiguity refuse the temptation to guess.
>>
>> there are many features of Python (& other languages) i did not now when
>> I started but have adopted once I understood what they were & how they
>> worked. then again use what you are most comfortable with.
>>
>> Practicality beats purity
>>
>
> I much prefer the alternative <> for != but some silly people insisted
> that this be removed from Python3.  Just how stupid can you get?
>

So which special methods should the <> operator call?  By rights it 
ought to call both __gt__ and __lt__ and return True if either of them 
is True.


-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Differences of "!=" operator behavior in python3 and python2 [ bug? ] "Mr. Joe" <titanix88@gmail.com> - 2013-05-13 05:23 +0600
  Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Alister <alister.ware@ntlworld.com> - 2013-05-13 09:59 +0000
    Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Fábio Santos <fabiosantosart@gmail.com> - 2013-05-13 18:26 +0100
    Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Ned Batchelder <ned@nedbatchelder.com> - 2013-05-13 14:08 -0400
    Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Chris Angelico <rosuav@gmail.com> - 2013-05-14 04:15 +1000
    Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Fábio Santos <fabiosantosart@gmail.com> - 2013-05-13 19:28 +0100
      Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Alister <alister.ware@ntlworld.com> - 2013-05-13 21:17 +0000
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Fábio Santos <fabiosantosart@gmail.com> - 2013-05-13 22:48 +0100
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-13 23:53 +0100
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Dave Angel <davea@davea.name> - 2013-05-13 19:22 -0400
          Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-14 05:09 +0000
            Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-05-14 19:01 -0400
              Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-15 00:15 +0000
                Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-05-14 22:20 -0400
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Andrew Berg <bahamutzero8825@gmail.com> - 2013-05-13 18:27 -0500
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-13 17:32 -0600
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-14 05:21 +0000
          Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Alister <alister.ware@ntlworld.com> - 2013-05-15 14:41 +0000
        Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] Chris Angelico <rosuav@gmail.com> - 2013-05-14 17:31 +1000

csiph-web