En Thu, 29 Mar 2007 01:56:15 -0300, Steven D'Aprano  
<[EMAIL PROTECTED]> escribió:

> By the way, "id(obj) == id(another_object)" is just a long way of writing
> "obj is another_object".

Just as a side note: that's not true, testing by id() only works if both  
objects are alive at the same time.

py> id(object()) == id(object())
True
py> object() is object()
False

So using the `is` operator is the only safe way to test for identity.

-- 
Gabriel Genellina

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

Reply via email to