Exposing buffer interface for non-extension types?

Robert Kern robert.kern at gmail.com
Tue Jul 20 22:02:17 EDT 2010


On 7/20/10 9:17 PM, sturlamolden wrote:
> On 21 Jul, 02:38, Ken Watford<kwatford+pyt... at gmail.com>  wrote:
>
>> Perhaps, but *why* is it only a pure C-level interface?
>
> It is exposed to Python as memoryview.

That's not really his question. His question is why there is no way for a pure 
Python class (like SWIG wrappers) have no way to expose the buffer interface. 
memoryview allows pure Python code to *consume* the buffer interface but not for 
pure Python classes to *provide* it.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list