[Python-3000] Immutable bytes type and bsddb or other IO
"Martin v. Löwis"
martin at v.loewis.de
Fri Aug 24 07:09:28 CEST 2007
> It *does* implement that! So there's the solution: these APIs should
> not insist on bytes but use the buffer API. It's quite a bit of work I
> suspect (especially since you can't use PyArg_ParseTuple with y# any
> more) but worth it.
I think there could be another code for PyArg_ParseTuple (or the meaning
of y# be changed): that code would not only return char* and Py_ssize_t,
but also a PyObject* and fill a PyBuffer b to be passed to
PyObject_ReleaseBuffer(o, &b).
> BTW PyUnicode should *not* support the buffer API.
Why not? It should set readonly to 1, and format to "u" or "w".
Regards,
Martin
More information about the Python-3000
mailing list