On 3/21/07, Adam Olsen <[EMAIL PROTECTED]> wrote: > On 3/20/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > I've used a __key__() method quite successfully in my own code. Maybe > > we should provide a mixin like:: > > > > class KeyedComparisonMixin(object): > > def __eq__(self, other): > > return self.__key__() == other.__key__() [snip] > This seems to match what I've usually needed, but I'm not sure it's > worth putting in python proper. How about a cookbook entry? It would > also be nice to reference in a guide on making code 3.0-ready.
Done. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/510403 STeVe -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
