[Python-Dev] Fwd: Problem withthe API for str.rpartition()
Barry Warsaw
barry at python.org
Tue Sep 5 19:52:45 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sep 5, 2006, at 1:46 PM, Raymond Hettinger wrote:
>> ISTM this is just begging for newbie (and maybe not-so-newbie)
>> confusion. Why not just document both as returning (left, sep,
>> right) which seems the most obvious description of what the
>> methods return?
>
>
> I'm fine with that (though it's a little sad that we think the
> rather basic concepts of head and tail are beyond the grasp of
> typical pythonistas).
>
> Changing to left/sep/right will certainly disambiguate questions
> about the ordering of the return tuple. OTOH, there is some small
> loss in that the head/tail terminology is highly suggestive of how
> to use the function when making succesive partitions.
Personally, I'd rather the docstring be clear and concise rather than
suggestive of use cases. IMO, the latter would be better served as
an example in the latex documentation.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRP25cXEjvBPtnXfVAQJ4EwQAuKnVxtyabdtAv/Eu9CcZ8EkcwCJYOoAT
DmgMWeml861Sn4qN6NV1vMKbXljxiKqoSBgbKdpU+FRb6TeNiCisuWA0Q9xoOfsj
Jyvy3XN54WXCUBNBnfsfUROPqxjiNGnKxYUzx2a+pjkeSSSZxDzbuplU+2ijB6w4
HJWIT4JLldA=
=u6iU
-----END PGP SIGNATURE-----
More information about the Python-Dev
mailing list