Thomas Heller <[EMAIL PROTECTED]> wrote:
> AFAIK, the buffer object now does not hold a pointer into the object
> it has been constructed from, it only gets it when its needed.
>
> IMO Objects/bufferobject.c, revision 35400 is considered safe.
>
> The checkin comment (by nascheme) was, more than
Josiah Carlson schrieb:
> Thomas Heller <[EMAIL PROTECTED]> wrote:
>> But that was not the question. What about the status of the buffer function?
>
>>From what I understand, it is relatively safe as long as you don't
> mutate an object while there is a buffer attached to it.
>
> That is:
>
>
On Jul 13, 2006, at 12:52 PM, Thomas Heller wrote:
> IIUC, the buffer object was broken some time ago, but I think it has
> been fixed. Can the 'status' of the buffer function be changed?
> To quote the next question from the OP:
>
> "Is buffer safe to use? Is there an alternative?"
>
> My th
Thomas Heller <[EMAIL PROTECTED]> wrote:
> But that was not the question. What about the status of the buffer function?
>From what I understand, it is relatively safe as long as you don't
mutate an object while there is a buffer attached to it.
That is:
import array
a = array.array(...
Fredrik Lundh schrieb:
> Thomas Heller wrote:
>
Naturally I tried to call base64.encodestring(buffer(ctypes_instance))
and it worked, so that was my answer.
> >>
>>> does ctypes_instance implement the buffer API ? if it does, is the
>>> buffer() call even necessary ?
>>
>> Yes, in bo
Thomas Heller wrote:
>>> Naturally I tried to call base64.encodestring(buffer(ctypes_instance))
>>> and it worked, so that was my answer.
>>
>> does ctypes_instance implement the buffer API ? if it does, is the
>> buffer() call even necessary ?
>
> Yes, in both cases.
are you sure? does it i
Fredrik Lundh schrieb:
> Thomas Heller wrote:
>
>> Naturally I tried to call base64.encodestring(buffer(ctypes_instance))
>> and it worked, so that was my answer.
>
> does ctypes_instance implement the buffer API ? if it does, is the
> buffer() call even necessary ?
Yes, in both cases.
Thomas
Thomas Heller wrote:
> Naturally I tried to call base64.encodestring(buffer(ctypes_instance))
> and it worked, so that was my answer.
does ctypes_instance implement the buffer API ? if it does, is the
buffer() call even necessary ?
___
Python-Dev m
I just answered a question on comp.lang.python for someone
who was asking about how to convert the internal buffer of
a ctypes instance into base64 coding, without too much copying:
"The conversion calls in the base64 module expect strings as input, so
right now I'm converting the binary block