[Python-Dev] pre-PEP: The Safe Buffer Interface

Guido van Rossum guido@python.org
Tue, 30 Jul 2002 17:13:00 -0400


>    I see this interface as a bridge between objects offering generic buffer
> oriented facilities (asynch or low level I/O for example) and objects that
> want to make it possible to use these facilities on their data (text
> buffers, multimedia buffers, numeric arrays) by yielding a pointer to their
> otherwise internal data.
> 
>    The bridging code between the two objects is unrestricted Python code
> that may cause memory to be moved around.

If the buffer is relatively small, copying the data an extra time
shouldn't be a problem, and you can use the old API.

If the buffer is huge, you probably shouldn't want to move the buffer
around in memory anyway, 

So I don't think your case for needing a lockable interface is very
strong.

--Guido van Rossum (home page: http://www.python.org/~guido/)