[Python-Dev] Proof of the pudding: str.partition()
greg.ewing at canterbury.ac.nz
Thu Sep 1 05:40:56 CEST 2005
Josiah Carlson wrote:
> A bit of free thought brings me to the (half-baked) idea that if string
> methods accepted any object which conformed to the buffer interface;
> mmap, buffer, array, ... instances could gain all of the really
> convenient methods that make strings the objects to use in many cases.
Not a bad idea, but they couldn't literally be string methods.
They'd have to be standalone functions like we used to have in
the string module before it got mercilessly deprecated. :-)
Not sure what happens to this when the unicode/bytearray future
arrives, though. Treating a buffer of bytes as a character
string isn't going to be so straightforward then.
More information about the Python-Dev