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


Groups > comp.lang.python > #79733

id == vs is

Date 2014-10-26 17:12 -0700
Subject id == vs is
From Dan Stromberg <drsalists@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15206.1414368757.18130.python-list@python.org> (permalink)

Show all headers | 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