[Python-Dev] strop vs. string

M.-A. Lemburg mal@lemburg.com
Sun, 27 May 2001 12:30:48 +0200


Mark Hammond wrote:
> 
> [Tim]
> > 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?
> 
> My take is a little different.  I think people could be convinced to care
> about it, and indeed I do.  However, it has one fatal flaw, and no one seems
> to know what to do about it.
> 
> The problem is the one best demonstrated with the array module - if you get
> a pointer to the buffer interface for an array object, but the array then
> resizes itself, the buffer pointer dangles.

I guess there are three ways to "solve" this:

a) mutable types don't implement the getreadbuf interface

b) the getreadbuf interface is complemented with a callback
   interface, so the the buffer object can be notified of
   the change

c) calling getreadbuf on a mutable object causes this object
   to become immutable

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