Stefan Krah added the comment:

So the problem is that readinto(view) might result in several references
to view? I don't think that can be solved on the memoryview side.

One could do:

   view = PyMemoryView_FromObject(b);
   // Lie about writability
   ((PyMemoryViewObject *)view)->view.readonly = 0;

   [...]

Then the view owns a reference to the bytes object. But that does not
solve the problem that writable memoryviews based on a readonly object
might be hanging around.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15903>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to