A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-July/026539.html below:

[Python-Dev] Fw: Behavior of buffer()

[Python-Dev] Fw: Behavior of buffer()Todd Miller jmiller@stsci.edu
Mon, 15 Jul 2002 11:17:37 -0400
Guido van Rossum wrote:

>>>How do you use buffers?  
>>>
>
>>We use buffers in numarray to store our array data.   We use readinto to 
>>load array buffers efficiently from a file.    We operate on the buffer 
>>data in-place.  Since numarrays are python classe instances, buffers 
>>provide a place for the data to live.
>>
>
>AFAIK the buffer() function can only create read-only buffers.  How do you...
>
We have a very small extension function which creates writeable buffer 
objects using the buffer type C-API.  

We also wrap suitable type instances with a "buffer object wrapper". 
 I'm slowly gathering that this is unsafe.   :-(

>
>you create your buffers?  If you're just using the C buffer API,
>that's not going away.
>
>>>Do you stick to their C API?  
>>>
>>We use the C-API, and currently use the buffer object too.   Using the 
>>buffer object has always seemed like a necessary evil, but having 
>>reviewed numarray usage of buffer(), ditching it sounds good to me.
>>
>
>Good.
>
>>>And from where do you get a buffer?  There are darned few types in Python
>>>
>
>>We get ours from mmap and our own homegrown memory object.
>>
>
>Maybe instead of the buffer() function/type, there should be a way to
>allocate raw memory?
>
Yes.    It would also be nice to be able to:

1.  Know (at the python level) that a type supports the buffer C-API.

2.  Copy bytes from one buffer to another (writeable buffer).  

>
>
>--Guido van Rossum (home page: http://www.python.org/~guido/)
>

Todd

-- 
Todd Miller 			
Space Telescope Science Institute







RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4