[Python-Dev] strop vs. string

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


Greg Stein wrote:
> 
> No... what needs to happen is to have the bug in PyBufferObject fixed. Then
> to refactor stringobject.c and stropmodule.c to move all of those
> byte-oriented processing functions into a new file such as Python/byteops.c
> (whatever; name isn't important). Ideally, stringobject.c and stropmodule.c
> would be simple covers over the same functions.
> 
> Those functions can then be used by PyBufferObject to implement the rest of
> the string methods on itself.
> 
> This would leave us at MAL's suggested point: via the buffer object, we can
> perform all of the standard string methods/ops on any object that implements
> the buffer API.

I wonder how we could achieve this without copy&pasting all
the needed methods from stringobject.c to bufferobject.c....
all the string methods use the string object layout directly
rather than just dealing with a pointer and a length.

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