[Python-Dev] strop vs. string

M.-A. Lemburg mal@lemburg.com
Sat, 26 May 2001 17:47:47 +0200


Tim Peters wrote:
> 
> The buffer object has been neglected for years:  is that because it's in
> prime shape, or because nobody cares about it enough to maintain it?  "The
> bug" has been known for years without any action taken to address it; the
> docs give up in spots and nobody addresses that either (like "The current
> policy seems to state that these characters may be multi-byte characters" --
> well, yes or no?); the builtin buffer() function isn't called anywhere in
> the std test suite; the file object still has an undocumented readinto()
> method that just confuses people who bump into it; and it's so obscure in
> daily life that it appears Guido didn't even think of it when adding
> iterators for the other sequence types.
> 
> I expect that answers my question <wink>.  Is someone (Greg? MAL?) going to
> champion it now?  That would be cool.

I believe that nobody really likes the buffer interface enough to
let the world know about it, except maybe Greg ;-)

Even the idea of replacing the usage of strings as data buffers
with buffer object didn't get very far; common habits are simply
hard to break.

> About combining strop and buffers and strings, don't forget unicodeobject.c:
> that's got oodles of basically duplicate code too.  /F suggested dealing
> with the minor differences via maintaining one code file that gets compiled
> multiple times w/ appropriate #defines.

Hmm, that only saves us a few kB in source, but certainly not
in the object files. 

The better idea would be making the types subclass from a generic 
abstract string object -- I just don't know how this will be 
possible with Guido's type patches. We'll just have to wait, 
I guess.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/