Pierre Barbier de Reuille <[EMAIL PROTECTED]> wrote: > Now suppose you have two classes A and B, B subclassing A. > If you define : > > @method(A) > def myfct(f): > do_something_with_f > > Then, you want it to work with any object of type B ... but with either > Guido's or this implementation, it won't ! The problem is much more > complex and cannot be solved in constant (or even linear) time. What I > read concerning Lisp is they use a cache to optimize method > resolution.
Yes, I realised that subclass/superclass relations cannot be quicly solved. I haven't looked at the Lisp implementation and can't comment on it. I suspect that using something like splay trees to re-adjust the search graph at every search would speed things up a bit. -- Catalin -- http://mail.python.org/mailman/listinfo/python-list