
Aug. 31, 2005
3:44 a.m.
On 8/31/05, Guido van Rossum <guido@python.org> wrote:
Hm. The example is poorly chosen because it's an end case. The invariant for both is (I'd hope!)
"".join(s.partition()) == s == "".join(s.rpartition())
<snip>
(Just think of it as rpartition() stopping at the last occurrence, rather than searching from the right. :-)
Ah, that makes a difference. I could see that there was a different way of looking at the function, I just couldn't see what it was... Now I understand the way it's been done. Cheers, Andrew.