[Python-3000] Builtin iterator type

Gareth McCaughan gmccaughan at synaptics-uk.com
Thu Nov 16 16:39:11 CET 2006


[Talin:]
> > With multiple dispatch, its easy to spell out what will happen in each
> > possible permutation of arguments - and if you get an ambiguity, the
> > dispatcher will let you know about it, instead of simply choosing an
> > implementation arbitrarily.

[George Sakkis:]
> Interesting idea, certainly not mainstream for the moment though.

(Who cares whether it's "mainstream"? For what it's worth, the
idea has been around for decades.)

> Short question: how do multiple dispatch systems deal with the
> combinatorial explosion ? I guess there should be a way to avoid
> having to spell out all combinations every time, or it will soon be
> unpractical.

What combinatorial explosion?

If you restrict yourself to what can be expressed in a traditional
single-dispatch OO system, there is no combinatorial explosion;
the complexity is no greater than for single dispatch.

Multiple dispatch allows you to express much more. Some versions
of "much more" would involve defining an enormous number of
methods, but that's no more a problem with multiple dispatch
than the fact that multidimensional arrays can use a huge
amount of memory is a problem with multidimensional arrays.

-- 
g



More information about the Python-3000 mailing list