I come to praise .join, not to bury it...

Russell E. Owen owen at astrono.junkwashington.emu
Thu Apr 12 13:08:38 EDT 2001


In article <rodB6.6847$4N4.1487790 at newsc.telia.net>,
 "Fredrik Lundh" <fredrik at pythonware.com> wrote:

>Jürgen A. Erhard wrote:
>> One of the best: Smalltalk does has `join' as a method of
>> *collections*, not strings!  One *might* think that the designers of
>> Smalltalk were... well, not the most stupid people on the planet.
>
>if you can find Python's collection base class, we're happy
>to add a join method to it.

I am curious about that. What *would* be involved in creating such a 
base class or collection class hierarchy? I can imagine several uses for 
it (in addition to join), including:
- subclassing to make new kinds of collections; collection could do most 
of the work
- type checking (is this an instance of the collection base class?)
- the % operator could work on any kind of collection; I occasionally 
try to use a list instead of a tuple

-- Russell



More information about the Python-list mailing list