Adding static typing to Python
Alexander Jerusalem
ajeru at vknn.org
Tue Feb 19 22:01:19 EST 2002
> It's only of the first argument, but that's what mono-dispatch means.
> Static typing having anything to do with multi-dispatch is incorrect,
> though. The best-known object system with multi-dispatch is CLOS, which
> is certainly dynamic.
I just looked up what CLOS does. I don't know if you call that static
typing or not. In any case, CLOS does have type declarations in the
source code which is what I want and what enables the features I'd
like to see in Python. For example in CLOS you can have the following
method declarations:
(defmethod Area ((C Circle)) (* pi (Square (Radius C)))
(defmethod Area ((R Rectangle)) (* (Width R) (Height R)))
(defmethod Area ((Sq Square)) (Square (Width Sq)))
OR (defmethod Height ((Sq Square)) (Width Sq))
Alexander
More information about the Python-list
mailing list