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

Jiwon Seo seojiwon at gmail.com
Tue Sep 5 20:33:59 CEST 2006


On 9/5/06, Barry Warsaw <barry at python.org> wrote:
> -----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. :)
>

but when it comes to cadr, cddr, cdar... ;^)

I personally prefer  (left, sep, right ) since it's most clear and
there are many Python programmers whose first language is not English.

> 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-----
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/seojiwon%40gmail.com
>


More information about the Python-Dev mailing list