On Oct 6, 7:23 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 6, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Oct 6, 7:01 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > > wrote: > > > It's a very object oriented solution. Essentially you're inheriting > > > all the classes that you want to fail, from a class that does. > > > But not a very good solution to the problem... > > > The specific problem is to determine if an arbitrary class implements > > a specified comparison method. The general problem (that gives rise to > > the specific problem) is to write a class decorator that can implement > > all comparison methods from a class that implements only one. > > > See:http://code.activestate.com/recipes/576529/ > > > Michael > > --http://www.ironpythoninaction.com/ > > Nope, I'm out of ideas, I'm afraid.
Thankfully that page I pointed you to has the solution I came up with - walk the method resolution order of the class checking in the classes' '__dict__' to see what they explicitly implement. Given that you can get hold of X.__lt__ I was surprised by how hard it was to tell whether that was an inherited implementation or not. Michael -- http://www.ironpythoninaction.com -- http://mail.python.org/mailman/listinfo/python-list