[Python-Dev] PEP 296 - The Buffer Problem

Todd Miller jmiller@stsci.edu
Wed, 24 Jul 2002 07:21:41 -0400


Scott Gilbert wrote:

>--- Todd Miller <jmiller@stsci.edu> wrote:
>
>>Letting the inner-thing be a mmap would enable slices of a mmap as views 
>>as opposed to strings.  We'd certainly like this for numarray, 
>>especially if it meant pickling efficiency for mmap based arrays.
>>
>
>The first version of the PEP I sent to you directly didn't have this, but
>the latest version I posted to python-dev mentions it briefly.  It seems
>both you and Guido came up with the same idea regarding mmap.
>
Yeah, I saw that in your respose.  Sorry.   FWIW,  anything I say here 
should be regarded as a reflection of STSCI's current technical goals as 
channeled by me, and not necessarily "my ideas".   Exploiting mmapping 
has been a pretty long standing goal here at STSCI.

>
>
>The current strategy is to add a method to the mmap module that would
>return a bytes object from an mmap object.  I would like it to be able to
>pickle too.  (Which probably means the new method in the mmap module will
>probably return a class derived from bytes, and not the bytes base class.)
>
This runs pretty wide of my current mental ruts, but it sounds like 
conservative design, so great.

>
>However, this is sort of orthogonal to the PEP.  If the bytes object makes
>it in, but the mmap enhancements get left out, a third party extension
>could implement the mmap_to_bytes function and still make use of the
>efficient pickling by deriving from the bytes object.
>
I understand.  That sounds excellent.

>
>
>Cheers,
>    -Scott
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
Back to numarray,
Todd