Python complaints

Fredrik Lundh fredrik at pythonware.com
Sun Dec 19 11:45:43 EST 1999


Quinn Dunkan <quinn at cruzeiro.ugcs.caltech.edu> wrote:
> >>  As someone else pointed out using the buffer object as an example,
> >>this doesn't always make sense. 
> >
> >Umm... could someone point me toward some documentation on this
> >elusive object? It sounds useful, if I can ever find it.
> 
> I think he's referring to StringIO/cStringIO, which simlpy provides
> read() write() etc. so it looks like a file object but really stores
> it in a string.  It's in the library ref.

or maybe he was referring to the kind of objects created by
the builtin "buffer" function, which provides a sequence API
to any object implementing the internal buffer interface.

or in other words, it's n obscure way to peek into the innards
of certain kinds of objects:

>>> a = "abc"
>>> b = buffer(a)
>>> b
<read-only buffer for 80bd238, ptr 80bd24c, size 3 at 80bd0e8>

python uses the interface API to avoid copying under
certain circumstances.

it can also be used to crash the interpreter in various
interesting ways...

</F>





More information about the Python-list mailing list