[Python-3000] Function overloading (Math in Python 3.0)

Guido van Rossum guido at python.org
Fri May 19 07:17:18 CEST 2006


On 5/13/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Nick Coghlan wrote:
>
> > Py3k's function overloading should fix this:
>
> People are starting to talk about "Py3k's function overloading"
> as though it were a done deal. Has anything actually been
> decided about it yet.

To the contrary. My own expectation is that at best we'll have a
library module which supplies overloaded/generic functions (perhaps
along the lines of what I checked into sandbox/overload, perhaps as an
extension module for speed). This would be usable by certain parts of
the standard library (perhaps pickle.py and copy.py could use it, if
we can solve the subclassing issue for a handful of built-in types
that get special-cased for space savings). I doubt that any built-in
functions would be overloaded. I doubt that math.sqrt() would use it.
Perhaps a generic math module (gmath?) could be supplied that provided
overloaded versions of some or most math functions.

But even so we'd have to solve the delayed-loading issue: you don't
want "import gmath" to imply "import decimal, math, cmath, gnump" nor
would you (ideally) have "import decimal" imply "import gmath". But if
both are imported (in either order) the right thing should happen.
How...?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list