[Python-Dev] Remove str.find in 3.0?
Gareth McCaughan
gmccaughan at synaptics-uk.com
Wed Aug 31 12:38:01 CEST 2005
> Just to put my spoke in the wheel, I find the difference in the
> ordering of return values for partition() and rpartition() confusing:
>
> head, sep, remainder = partition(s)
> remainder, sep, head = rpartition(s)
>
> My first expectation for rpartition() was that it would return exactly
> the same values as partition(), but just work from the end of the
> string.
>
> IOW, I expected "www.python.org".partition("python") to return exactly
> the same as "www.python.org".rpartition("python")
Yow. Me too, and indeed I've been skimming this thread without
it ever occurring to me that it would be otherwise.
> Anyway, I'm definitely +1 on partition(), but -1 on rpartition()
> returning in "reverse order".
+1.
--
g
More information about the Python-Dev
mailing list