In article mailman.15221.1414379336.18130.python-l...@python.org,
Cameron Simpson c...@zip.com.au wrote:
The is test is more direct and less subject to iffiness because the longer
expression using id() leaves more scope/time for things to change, and of
course id itself can be rebound to
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
On 2014-10-27 00:12, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
?
Yes.
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
On 27 October 2014 00:12, Dan Stromberg drsali...@gmail.com wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
Much of the time, but not all the time. The obvious exception is if
id is redefined, but that one's kind of boring. The real thing to
watch out for is if the
On 10/26/2014 05:23 PM, Ethan Furman wrote:
On 10/26/2014 05:12 PM, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
?
Listen to MRAB, ignore me.
That is all.
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 10/26/2014 05:12 PM, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
?
Nope. If the value if `id(x)` is not interned, then the two value could be different objects that still represent the
same value.
--
~Ethan~
--
On 2014-10-27 00:24, Ethan Furman wrote:
On 10/26/2014 05:23 PM, Ethan Furman wrote:
On 10/26/2014 05:12 PM, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
?
Listen to MRAB, ignore me.
That is all.
Well, apart of Joshua's qualifications, that is!
Dan Stromberg drsali...@gmail.com writes:
Are the following two expressions the same?
x is y
Id(x) == id(y)
It depends what you mean by “the same”.
Do they give the same result? Sometimes yes, sometimes no. It depends on
what the types of the values are.
Do they express the same intent?
On Sun, 26 Oct 2014 17:12:29 -0700, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
No, although if Id and id were the same function, they might be
equivalent in some cases.
--
Denis McMahon, denismfmcma...@gmail.com
--
On 27Oct2014 00:41, MRAB pyt...@mrabarnett.plus.com wrote:
On 2014-10-27 00:24, Ethan Furman wrote:
On 10/26/2014 05:23 PM, Ethan Furman wrote:
On 10/26/2014 05:12 PM, Dan Stromberg wrote:
Are the following two expressions the same?
x is y
Id(x) == id(y)
?
Listen to MRAB, ignore me.
That
Ben Finney ben+pyt...@benfinney.id.au writes:
Dan Stromberg drsali...@gmail.com writes:
Are the following two expressions the same?
[…]
It depends what you mean by “the same”.
My apologies, I mis-read the question. My answers were for a different
question (one you didn't ask). Please ignore
11 matches
Mail list logo