On Tuesday 02 November 2010, 11:26:46 Giovanni Bajo wrote:
> On mar, 2010-11-02 at 10:16 +0000, Phil Thompson wrote:
> > On Tue, 2 Nov 2010 00:00:06 +0200, "Hans-Peter Jansen"
> > <[email protected]>
> >
> > wrote:
> > > Hi Phil,
> > >
> > > end of July last year, Alexandre Raczynski asked about accessing
> > > QSharedMemory, and you replied, that:
> > >
> > > mutable_data = buffer(sharedMemory.data())
> > >
> > > ...should give _write_ access to the memory.
> >
> > ...bad advice. I didn't realise that you can't create mutable
> > buffers from Python. (Although there is no reason why you shouldn't
> > be able to.)
>
> Actually, Python 2.7 has memoryview(); if
> memoryview(sharedMemory.data()) worked, it would be possible to use
> memoryview's method to mutate the buffer, without having to come up
> with a different API for sip.voidptr.

Giovanni, isn't memoryview just a different _interface_ to the buffer 
protocol? Anyway, being able to use QSharedMemory with 2.7 and higher 
only looks like an arbitrary restriction to me. At least many of my 
production systems would be locked out, then. For proper support, Phil 
might have to do both variants of the buffer protocol anyway..

Pete
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to