>>Read the comments. What you say is essentially the same - the data >>matters, after all. What do you care if there are several instances >>around? >> > In my case it matters more that the objects are the same. > > For example I want set([Spam(1), Spam(2), > Spam(3)]).intersect(set([Spam(1), Spam(2)]) to contain two items instead > of 0. > > For this and many other reasons it's important that Spam(n) is Spam(n).
Ah, ok. Well, you could always use the __hash__ method to ensure that - might be better anyway, because then _you_ define what equality means. But YMMV. Diez -- http://mail.python.org/mailman/listinfo/python-list