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

Rainer Deyke root at rainerdeyke.com
Sun Mar 4 16:05:27 EST 2001


"John W. Baxter" <jwbnews at scandaroon.com> wrote in message
news:jwbnews-665CC3.11122604032001 at corp.supernews.com...
> OK, thanks.  I'm convinced.  For the first time.  (Which won't
> necessarily keep me from writing non-polymorphic things with the string
> module, but it might make me *try* to remember.)

Actually, since the introduction of string methods, the string module has
started to behave polymorphically.  Here's the implementation of
'string.join' as of 2.0:

def join(words, sep = ' '):
    return sep.join(words)

String method make the string module more powerful.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list