Method or function?

Dale Strickland-Clark dale at out-think.NOSPAMco.uk
Fri Nov 3 03:18:13 EST 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote:

>"Rainer Deyke" <root at rainerdeyke.com> wrote in message
>news:1E8M5.152239$g6.69207599 at news2.rdc2.tx.home.com...
>    [snip]
>> It bothers me that a function with two (or more) arguments which are
>treated
>> equally is implemented as a method of one of the arguments.  It's
>asymetric.
>
>I think the only _elegant_ way out of this asymmetry is the one indicated
>by Dylan's multimethod-dispatch of generic functions, which treats all
>arguments impartially.  "method-notation" in Dylan, foo.bar, is just
>syntax sugar for a normal function call, bar(foo) [Dylan only allows this
>specific sugar for 1-argument functions, but one might extend it to have
>foo.bar(baz) mean bar(foo,baz), etc, I guess].
>

The new string methods prompted my original post - and in particular,
the lack of a len() method which seems an obvious addition to me.

I was also curious about the new join() method which strikes me as
being the wrong way around. Join should be a method of sequences not
of the string that is placed between the elements.


--
Dale Strickland-Clark
Out-Think Ltd
Business Technology Consultants





More information about the Python-list mailing list