[Python-Dev] String methods... finally

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Fri Jun 11 20:22:36 CEST 1999


    >> Perhaps join() ought to be a built-in function?

IMO, builtin join ought to str()ify all the elements in the sequence,
concatenating the results.  That seems an intuitive interpretation of
'join'ing a sequence.  Here's my Python prototype:

def join(seq, sep=''):
    if not seq:
        return ''
    x = str(seq[0])
    for y in seq[1:]:
        x = x + sep + str(y)
    return x

Guido?

-Barry




More information about the Python-Dev mailing list