Message235256
| Author |
skrah |
| Recipients |
Arfrever, belopolsky, larry, martin.panter, pitrou, serhiy.storchaka, skrah |
| Date |
2015年02月02日.13:09:50 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<20150202130939.GA15261@bytereef.org> |
| In-reply-to |
<1422828781.74.0.0703292308184.issue22896@psf.upfronthosting.co.za> |
| Content |
Thanks. No, I don't think there's an official way to accomplish that,
but let's create one. How about a new function that takes the buffer
request flags:
PyMemoryView_FromObjectEx(exporter, PyBUF_SIMPLE|PyBUF_WRITABLE)
If we can spare a new format code, this could be called directly in
PyArg_ParseTuple(), which would give back the memoryview.
Otherwise, you get the exporter from PyArg_ParseTuple() and call
PyMemoryView_FromObjectEx() manually.
If I'm not mistaken, this would save us the intermediate buffer on the
stack, and it's more readable. |
|