Method or function?

Quinn Dunkan quinn at regurgitate.ugcs.caltech.edu
Fri Nov 3 13:35:53 EST 2000


On Fri, 3 Nov 2000 12:57:24 +0100, Alex Martelli <aleaxit at yahoo.com> wrote:
[ snip example of why join should dispatch on the joiner ]
>If join was dispatched _on the sequence_, how
>could we redefine emit, to use multiple separators
>by default, but still be easily callable with a
>different separator (joiner, I'd call it:-)
>object?  I think it would have to be rather less
>direct, more abstruse, with a sequence-wrapping
>class etc etc.
>
>
>Sure, multiple dispatch would ensure the most
>potential generality.  But as long as dispatch
>is to be on one object only (the method's
>"owner"), then it definitely seems to me that
>having that object be the joiner rather than
>the joinee is by far the best architecture
>for the join method.

Well spoken; I see your point.  I still don't like join, but I think it's just
the *name* that's backwards: it should be called s.seperate().

And in fact, I just noticed that in other languages it *is* called
s.seperate :)

Or maybe 'join' is ok... arghh, they both sorta work.

I love it when two antonyms mean the same thing :)



More information about the Python-list mailing list