Peter Otten schrieb: > class Grab: > def __init__(self, value): > self.search_value = value > def __hash__(self): > return hash(self.search_value) > def __eq__(self, other): > if self.search_value == other: > self.actual_value = other > return True > return False > > assert a == z > assert a is not z > grab = Grab(z) > grab in s > assert grab.actual_value is a
Wow, this is truly amazing! I'd never have come up with that solution. Just wonderful, thank you very much! :-)) Kind regards, Johannes -- "Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit, verlästerung von Gott, Bibel und mir und bewusster Blasphemie." -- Prophet und Visionär Hans Joss aka HJP in de.sci.physik <48d8bf1d$0$7510$54022...@news.sunrise.ch> -- http://mail.python.org/mailman/listinfo/python-list