[Python-ideas] ExternalMemory

Antoine Pitrou solipsis at pitrou.net
Wed Oct 27 12:48:26 CEST 2010


On Wed, 27 Oct 2010 12:02:11 +0800
Kristján Valur Jónsson
<kristjan at ccpgames.com> wrote:
> 
> First of all, I'd futilely  like to suggest this change for 2.x.  The existing
> PyBuffer_FromMemory() provides no lifetime management.

By "futilely" you mean you know it won't be accepted, since 2.x is in
bug fixes-only mode? :)

> So, for py3k, I'd actually like to extend the Memoryview object, and
> provide something like PyMemoryView_FromExternal() that takes an
> optional pointer to a "void destructor(void *arg, void *ptr)) and an
> (void *arg), to be called when the buffer is released.

Sounds reasonable to me.

Regards

Antoine.





More information about the Python-ideas mailing list