MethodChain

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sun Jul 20 07:01:32 CEST 2008


On Sat, 19 Jul 2008 13:57:33 -0700, bearophileHUGS wrote:

> Marc 'BlackJack' Rintsch:
>> What's called `MethodChain` there seems to be function composition in
>> functional languages.  Maybe `functools` could grow a `compose()` function.
> 
> To me it looks like a quite more "refined" thing, it's an object, it
> has some special methods, etc. I think it's not too much difficult to
> implement it with Python.

The methods are a problem IMHO.  You can't add an own method/function with
the name `fire()` or `toFunction()`.  `MethodChain` has to know all
functions/methods in advance.  You can add the methods of whole classes at
once and there are over 300 pre-added, this begs for name clashes.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list