[Python-Dev] Memoryviews should expose the underlying memory address

Nick Coghlan ncoghlan at gmail.com
Fri Sep 21 05:19:06 CEST 2012

On Fri, Sep 21, 2012 at 9:37 AM, David Beazley <dave at dabeaz.com> wrote:
> A memory address is a number.   I think an integer is fine--if you're working at this level, you're already on your own and expected to know what you're doing.  I'd prefer to just get the raw address without yet another level of indirection.
> Other parts of the library already do this.   For instance array.buffer_info().

I'm fine with exposing a memoryview.buffer_address attribute in 3.4.
The idea had never come up before, as the idea of using *Python code*
(rather than C) to provide the shim between a PEP 3118 exporter and a
consumer that doesn't understand that API isn't a use case we had even
considered. memoryview has instead been more focused on *interpreting*
the contents of exported buffers as ordinary Python objects.

(We already know we still need to define an API to let classes defined
in Python implement the buffer API, though)


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list