[Python-Dev] String methods... finally

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Sun Jun 13 19:56:33 CEST 1999


>>>>> "TP" == Tim Peters <tim_one at email.msn.com> writes:

    TP> Same here, except as a method we've got it twice backwards
    TP> <wink>: it should be a string method, but a method of the
    TP> *separator*:

    TP>     sep.join(seq)

    TP> same as

    |     convert each elt in seq to a string of the same flavor as
    |     sep, then paste the converted strings together with sep
    |     between adjacent elements

    TP> So

    TP>     " ".join(list)

    TP> delivers the same result as today's

    TP>     string.join(map(str, list), " ")

    TP> and

    TP>     L" ".join(list)

    TP> does much the same tomorrow but delivers a Unicode string (or
    TP> is the "L" for Lundh string <wink>?).

    TP> It looks odd at first, but the more I play with it the more I
    TP> think it's "the right thing" to do

At first glance, I like this proposal a lot.  I'd be happy to code it
up if David'll stop throwing those rocks.  Whether or not they hit me, 
they still hurt <snif> :)

-Barry




More information about the Python-Dev mailing list