[Tutor] creating a buffer object from a file ?

Alan Gauld alan.gauld at btinternet.com
Thu May 31 18:49:44 CEST 2007

"Jerry Hill" <malaclypse2 at gmail.com> wrote

>> I think this got lost among the threads:
> I think it got lost because you haven't given us enough information 
> to
> answer your question.
>> in reality what is a buffer object used for ? reading
>> a file itself creates a string as in itself,
> We don't know.  Your original email said you needed a buffer object,

The problem is that the Python docs refer to "a buffer object"
but are not very forthcoming about exactly what it is or when/why
you should use one. I confess that until Iyer asked his question
I didn't even know they existed and still don't know when or
why I'd need one.

They appear to be some kind of string based object used in
the internals of Python but with some operations blocked.
But the only halfway useful info is what you get when you
do help(buffer).

Sorry Iyer, I can't really tell you anymore than I did already.

As Jerry says, maybe if  you could remind us of the context
where you were told you needed to use a buffer object? I've never
seen such a demand in Python myself.

Alan G. 

More information about the Tutor mailing list