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


Groups > comp.lang.python > #79733

id == vs is

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <drsalists@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'python,': 0.02; 'expressions': 0.07; '(via': 0.16; 'ported': 0.16; 'to:name:python list': 0.16; 'first.': 0.19; 'tests': 0.22; 'java': 0.24; 'second': 0.26; 'idea': 0.28; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'equality': 0.31; 'thanks!': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'unit': 0.37; 'two': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'above,': 0.60; 'expression': 0.60
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=0EhwIv8wTwWAHKzfCm8xg/kazb5AXTtHg8Qtyhve4sE=; b=RZV3exVQZNcYwMLsDgsH5MQmhFKZENcKbTvfDvSvzXqrF3+LmHCMjzzAWUF13iKo5u suwpokpjZV4xLNAUE7BmPStgulpuDNBm1T6cTNSTtVsyN4aMAEJoNv0PitlJPKsL8dJS 7ChW/OmBGYN2O5LVEfor8dIAveaTHOShV7NTAaDFvJ257//8WJC/M8YwKwzqWPV3htfT hLlTyhrsz3kpr7nNneOivEgux+n6fybHa1JMZU0Zczk8WbisrZ7EjM8hg0REyOawu5c9 Li56yjBGZr0mcRxkNGO4GcOWHbRkGnnPhmdm3HRo3sgDO7XFbAXyvNeu+c3vXV+/AsvV A7vA==
MIME-Version 1.0
X-Received by 10.152.203.231 with SMTP id kt7mr5684217lac.84.1414368749083; Sun, 26 Oct 2014 17:12:29 -0700 (PDT)
Date Sun, 26 Oct 2014 17:12:29 -0700
Subject id == vs is
From Dan Stromberg <drsalists@gmail.com>
To Python List <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.15206.1414368757.18130.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414368757 news.xs4all.nl 2860 [2001:888:2000:d::a6]:32773
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79733

Show key headers only | View raw


Are the following two expressions the same?

x is y

Id(x) == id(y)

?

I ported some Java code to Python, and it was using Java's idea of
equality (via ==) in some places.  Right now, I have a suite of unit
tests working using the second expression above, but I'm thinking
about switching to the first.

Thanks!

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


Thread

id == vs is Dan Stromberg <drsalists@gmail.com> - 2014-10-26 17:12 -0700
  Re: id == vs is Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-27 01:47 +0000

csiph-web