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


Groups > comp.lang.python > #68185

Re: when to use == and when to use is

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'cc:addr:python-list': 0.11; '"=="': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'subject:when': 0.16; 'sender:addr:gmail.com': 0.17; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'agree': 0.35; 'case,': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'should': 0.36
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=un8RfT3ckOnBn3l2WlYE4quScQtqdND13M5Nnbz/DIk=; b=fWvFCmyuxNnmCbeM9sPl2CP6/NuLfa8NWA9Mi42TJyS+kUEJH3ICqceg9LHKLkuWK3 ral6bLKxheCpZpckLrppxctaIsrEqBUaoyDTH5lbPd9f5ZzRXr6YI43EDufM/yacAUKH 4G5L9d8fmpK6kOhWN3cPyNQp6XGJGbBVzMe5+Cx3pAFzoGCFuwxi1FO6qhuwasGFkCUk iGlYy4tmJ7ox23zcMIG5wwuFS3ZYBzozOrEyMiarHZeu2KZ9admZ3I14++oEazlRqZMy CCLhdoFbT8rw9PWeYtDm04v4W0+KMurCV6Fdz+l3pcNCuY+a8zgbAS9cG4Wd2+xtbaQb MI0g==
MIME-Version 1.0
X-Received by 10.50.47.231 with SMTP id g7mr7363036ign.8.1394497818218; Mon, 10 Mar 2014 17:30:18 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <531DFFED.7070509@noaa.gov>
References <531DFFED.7070509@noaa.gov>
Date Mon, 10 Mar 2014 19:30:18 -0500
X-Google-Sender-Auth SN3QonpQyjTeW7avo4OoQWb73Bw
Subject Re: when to use == and when to use is
From Skip Montanaro <skip@pobox.com>
To George Trojan <george.trojan@noaa.gov>
Content-Type text/plain; charset=UTF-8
Cc Python <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 <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8030.1394497827.18130.python-list@python.org> (permalink)
Lines 6
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394497827 news.xs4all.nl 2905 [2001:888:2000:d::a6]:53508
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68185

Show key headers only | View raw


I agree with Ben.

In this particular case, it seems you really should be using "=="
unless obj_0, obj_1, and obj_2 are sentinels.

Skip

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


Thread

Re: when to use == and when to use is Skip Montanaro <skip@pobox.com> - 2014-03-10 19:30 -0500

csiph-web