"George Sakkis" <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers wrote: > >> I must definitively be dumb, but so far I fail to see how it's better >> than split and rsplit: > > I fail to see it too. What's the point of returning the separator since > the caller passes it anyway* ? > The separator is only returned if it was found otherwise you get back an empty string. Concatenating the elements of the tuple that is returned always gives you the original string.
It is quite similar to using split(sep,1), but reduces the amount of special case handling for cases where the separator isn't found. -- http://mail.python.org/mailman/listinfo/python-list