PyMultimethods

davisn90210 at gmail.com davisn90210 at gmail.com
Wed Nov 28 00:57:06 EST 2007


miller.pau... at gmail.com wrote:
> On Nov 27, 7:14 pm, "davisn90... at gmail.com" <davisn90... at gmail.com>
> wrote:
> > I've written a small project that implements multimethods for python.
>
> Interesting. Were you aware of the article Guido wrote on multimethods
> in python? ( www.artima.com/weblogs/viewpost.jsp?thread=101605 )
> Although I'm a decent python programmer and could surely figure it out
> from the source, a file of example code showing how to use the module
> is always a good thing.  Also, you should consider submitting to pypi
> if you haven't already ( www.python.org/pypi ).

In fact, Guido's article is what inspired me to start this project in
the first place.  From a functional standpoint, my implementation
differs from Guido's on the following points:
1) Parameters also match on subtypes, rather than only the exact type
specified.
2) Support for keyword parameters.
3) Dispatch by value (currently quite rudimentary)

There is a "Getting Started" page in the wiki (http://
pymultimethods.wiki.sourceforge.net/Getting+Started), which contains
an example "Rock, Paper, Scissors" game that you can use to get
started.  There's also a rough tutorial at http://pymultimethods.wiki.sourceforge.net/Tutorial,
which covers more features.

I have many things planned for this project, one of which is
submitting to PyPI, but I'd rather let it season a little first.

Thanks for your comments,

--Nathan Davis



More information about the Python-list mailing list