[Python-Dev] buffer interface considered harmful

Greg Stein gstein@lyra.org
Sun, 15 Aug 1999 13:35:25 -0700


Fredrik Lundh wrote:
>...
> well, I think the buffer behaviour is both
> new and pretty funny:

I think the buffer interface was introduced in 1.5 (by Jack?). I added
the 8-bit character buffer slot and buffer objects in 1.5.2.

> from array import array
> 
> a = array("f", [0]*8192)
> 
> b = buffer(a)
> 
> for i in range(1000):
>     a.append(1234)
> 
> print b
> 
> in other words, the buffer interface should
> be redesigned, or removed.

I don't understand what you believe is weird here. Also, are you saying
the buffer *interface* is weird, or the buffer *object* ?

thx,
-g

--
Greg Stein, http://www.lyra.org/