Martin v. Löwis replies to my story: > Or, to make a long story short: there might not be a single next > best candidate, but multiple, which are mutually equally-good: > both mpz+object and object+array would match, and neither is > better than the other. > > This is because they only form a partial order. Of course, it > might be possible to impose a total order on top of it (e.g. > giving the left-more operands higher precedence, or considering > the order of registration). This all sound arbitrary, though.
That's a really good way of looking at it. Our current __add__()/ __radd__() system prefers the left argument. A multi-dispatch function with the strict dominance rule refuses to prefer either, raising an exception unless you register something to tell it what to do. I believe that's a point in FAVOR of the multi-dispatch function approach. Adding multi-dispatch functions to Python is a BIG, DEEP change. Similar, perhaps, to adding descriptors, not similar to adding a "with" statement. That means great care should be exercised, but also that great things are possible. -- Michael Chermside _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com