Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'that?': 0.05; 'subject:bug': 0.07; 'expected.': 0.09; 'statements': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'evaluating': 0.16; 'precedence': 0.16; 'precidence': 0.16; 'subject:python3': 0.16; 'wrote:': 0.18; '(not': 0.18; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; "didn't": 0.36; 'skip:& 10': 0.38; 'issue': 0.38; 'fact': 0.38; 'pm,': 0.38; 'rather': 0.38; 'sure': 0.39; 'personal': 0.63; 'more': 0.64; 'charset:windows-1252': 0.65; '"not': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=EShEA+FNE2hhZlDKILW8rzAV8HA+oKOyp0Tg6mLa2Ic=; b=WDsAXfb35G1wWaqWNIwai6XtUSkFNRPNsYIrM7mTXFArNjo9PPWXhfGUxbHpw2ID/O 9ZmhCdgA0M4qaxXzkWoMOI/wQCAI/xdkHTprNzfwWYdQ2l7oPVRniMZDl7a9ICyRFYDV azyMRcNv3CzJsttYNZjNQMcD9qud4R6E/NtNt9owZnlunKh+O/YZeHD9/coHQLhgr8Tv H7af+qjFNWewLlI9VjhI0mpBzffZKjHHsml538Qu08oDvfioRChTgGLVaU4AgjykK+j3 d80JfrghklafzTazJmEBKDCxVD4UzwLvmBb4nQzHKeHiirJp6cLhP7MDuN1+aB1UkYZ9 FkYQ== MIME-Version: 1.0 X-Received: by 10.229.13.205 with SMTP id d13mr743209qca.118.1368469709105; Mon, 13 May 2013 11:28:29 -0700 (PDT) In-Reply-To: <51912C27.3020809@nedbatchelder.com> References: <51912C27.3020809@nedbatchelder.com> Date: Mon, 13 May 2013 19:28:29 +0100 Subject: Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ] From: =?ISO-8859-1?Q?F=E1bio_Santos?= To: Ned Batchelder Content-Type: multipart/alternative; boundary=0015175743bce5b77e04dc9daebf Cc: python-list@python.org 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: 77 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368470096 news.xs4all.nl 15953 [2001:888:2000:d::a6]:51109 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45260 --0015175743bce5b77e04dc9daebf Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I think it is more readable. When doing more complicated statements I use !=3D instead, but when it's a single test I prefer not =85 =3D=3D It's a personal thing. It may also have to do with the fact that I didn't know python had !=3D when I was a novice. On 13 May 2013 19:08, "Ned Batchelder" wrote: > > On 5/13/2013 1:26 PM, F=E1bio Santos wrote: > > > On 13 May 2013 11:04, "Alister" wrote: > > this looks to me like an issue with operator precidence > > > > you code is evaluating as (Not x) =3D=3D y > > rather than not (x =3D=3D y) > > I can say for sure that the precedence is as expected. I always use "not > ... =3D=3D ..." Instead of !=3D. > > > If you don't mind my asking, why do you do that? > > --Ned. > > --0015175743bce5b77e04dc9daebf Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

I think it is more readable. When doing more complicated sta= tements I use !=3D instead, but when it's a single test I prefer not = =85 =3D=3D

It's a personal thing. It may also have to do with the f= act that I didn't know python had !=3D when I was a novice.

On 13 May 2013 19:08, "Ned Batchelder"= <ned@nedbatchelder.com>= wrote:
=20 =20 =20

On 5/13/2013 1:26 PM, F=E1bio Santos wrote:


On 13 May 2013 11:04, "Alister" <alister.ware@ntlworld.com> wrote:
> this looks to me like an issue with operator precidence
>
> you code is evaluating as (Not x) =3D=3D y
> rather than not (x =3D=3D y)

I can say for sure that the precedence is as expected. I always use "not ... =3D=3D ..." Instead of != =3D.



If you don't mind my asking, why do you do that?

--Ned.

--0015175743bce5b77e04dc9daebf--