How to test if an object IS another object?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Jun 12 16:02:11 EDT 2005


dan.eloff at gmail.com a écrit :
> If two objects are of equal value you can compare them with ==. What I
> want to do is find out if two objects are actually just references to
> the same object, how can I do this in Python?

The most obvious way (as usual ?):

if obj1 is obj2:
   // your code here





More information about the Python-list mailing list