new string method in 2.5 (partition)
johnjsal at NOSPAMgmail.com
Tue Sep 19 21:23:50 CEST 2006
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
> There are IMVHO much exciting new features in 2.5 (enhanced generators,
> try/except/finally, ternary operator, with: statement etc...)
I definitely agree, but I figure everyone knows about those already.
There are also the startswith() and endswith() string methods that are
new and seem neat as well.
More information about the Python-list