[Python-Dev] String methods... finally

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Wed Jun 16 01:27:44 CEST 1999

>>>>> "MH" == Mark Hammond <MHammond at skippinet.com.au> writes:

    MH> OTOH, my gut tells me this is better - that an implicit
    MH> conversion to the seperator type be performed.

Right now, the implementation of join uses PyObject_Str() to str-ify
the elements in the sequence.  I can't remember, but in our Unicode
worldview doesn't PyObject_Str() return a narrowed string if it can,
and raise an exception if not?  So maybe narrow-string's join
shouldn't be doing it this way because that'll autoconvert to the
separator's type, which breaks the symmetry.

OTOH, we could promote sep to the type of sequence[0] and forward the
call to it's join if it were a widestring.  That should retain the


More information about the Python-Dev mailing list