John Salerno schrieb: > Bruno Desthuilliers wrote: > >> Err... is it me being dumb, or is it a perfect use case for str.split ? > > Hmm, I suppose you could get nearly the same functionality as using > split(':', 1), but with partition you also get the separator returned as > well.
Well, x.split(":", 1) returns a list of one or two elements, depending on x, while x.partition(":") always returns a three-tuple. Thomas -- http://mail.python.org/mailman/listinfo/python-list