[Python-Dev] PEP 296 - The Buffer Problem

Scott Gilbert xscottg@yahoo.com
Wed, 24 Jul 2002 01:22:29 -0700 (PDT)


--- 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.

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.)

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.


Cheers,
    -Scott


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com