En Mon, 09 Aug 2010 08:41:23 -0300, saeed.gnu <saeed....@gmail.com> escribió:

"x is y"          means   "id(y) == id(y)"
"x is not y"      means   "id(x) != id(x)"

No; consider this:


py> id([])==id([])
True
py> [] is []
False

Comparing id's is the same as using the is operator only if you can guarantee that both operands are alive at the same time.


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to