Message263172
| Author |
martin.panter |
| Recipients |
benjamin.peterson, martin.panter, pitrou, serhiy.storchaka, stutzbach |
| Date |
2016年04月11日.09:29:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1460366994.81.0.301546229033.issue26720@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
To create a memoryview with unlimited lifetime, I understand we need to nominate an "exporting object", which becomes memoryview.obj. Using a bytes object here might be the simplest fix for just BufferedWriter.
However it looks like the buffer is shared with BufferedReader and others. To fix the analogous bug with BufferedReader, a bytearray might be better, because the user could see it being mutated when reading into the memoryview.
I think bytearray might be okay for BufferedWriter too, as long as we prevent it being resized. The user would be able to alter the contents of the buffer, but I don’t see that as a problem. An alternative would be a new opaque object that doesn’t do much except have a reference count. |
|