[Python-Dev] Fwd: Problem withthe API for str.rpartition()

Barry Warsaw barry at python.org
Tue Sep 5 20:12:16 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sep 5, 2006, at 2:06 PM, Raymond Hettinger wrote:

>> Then shouldn't rpartition be S.rpartition(sep) -> (rest, sep, tail)
>
> Gads, the cure is worse than the disease.
>
> car and cdr are starting to look pretty good ;-)

LOL, the lisper in me likes that too, but I don't think it'll work. :)

Fred's disagreement notwithstanding, I still like (left, sep, right),  
but another alternative comes to mind after actually reading the  
docstring for rpartition <wink>: (before, sep, after).  Now, that's  
not ambiguous is it?  Seems to work for both partition and rpartition.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRP2+AHEjvBPtnXfVAQLiPAP+N80jHkoT5VNTtX1h2cqD4pONz+j2maCI
QXDBoODucxLDPrig8FJ3c6IcT+Uapifu8Rrvd7Vm8gSPMUsMqAgAqhqNDbXTkHVH
xLk31en2k2fdiCQKQyKJSjE1R1CaFCezByV29FK3fWvqrrxObISRnsxf/wXB6Czu
pOUNSA9LLKo=
=g+iz
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list