-- multimethods in Python

Neel Krishnaswami
Wed, 12 Jan 00 07:17:13 GMT

I'd like to announce the existence of, a package that
implements real (eg, CLOS/Cecil/Dylan) multimethods for Python. These
are nifty for oodles of reasons, but some of the more significant are:

  o They make the Visitor and Strategy patterns trivial to implement.
  o The whole "binary method/double dispatch" problem goes away, thus 
    promoting loose coupling and other software-engineering buzzwords.
  o They resolve the whole contravariance/covariance debate so totally
    it's hard to remember what the problem was.

You can find it on my webpage at:


It should work out of the box on CPython 1.5.2, and Jpython if Jpython
has lists that support the insert() method. I don't know about Viper,
since Viper apparently has a rather different type system from vanilla
Python, but it should be easy to port, though.

The current version is quite rough, with lame algorithms used in a
couple of places and very substandard documentation. But it all works,
and is quite usable for experimentation and learning.

(Incidentally, is this the sort of thing that should go on the


<P><A HREF=""></A> - 
support for real (i.e. CLOS/Cecil/Dylan-style) multimethods for
Python.  (07-Jan-2000)

----------- comp.lang.python.announce (moderated) ----------
Article Submission Address:
Python Language Home Page:
Python Quick Help Index: