On Thu, 23 May 2013 12:12:26 +1000 Nick Coghlan <ncogh...@gmail.com> wrote: > On Thu, May 23, 2013 at 10:14 AM, Glenn Linderman <v+pyt...@g.nevcal.com> > wrote: > > Yet about half of the operator overloads would be incomplete if there were > > not corresponding __r*__ methods (__radd__, __rsub__, etc.) because the > > second parameter is as key to the dispatch as the first. > > > > While unary operators, and one argument functions would be fully covered by > > single dispatch, it is clear that single dispatch doesn't cover a large > > collection of useful cases for operator overloading. > > The binary operators can be more accurately said to use a complicated > single-dispatch dance rather than supporting native dual-dispatch.
Not one based on the type of a single argument, though. I guess you can also reduce every function of several arguments to a function accepting a single tuple of several items, but that doesn't sound very interesting. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com