[Python-3000] PEP 3137 plan of attack
Guido van Rossum
guido at python.org
Mon Oct 8 20:42:09 CEST 2007
On 10/8/07, Bill Janssen <janssen at parc.com> wrote:
> I think I can spend some time on the 3K SSL support, but I've been
> waiting till the "bytes" work settles down. Sounds like I should
> keep waiting a bit more? Or have the C APIs already settled?
The C APIs haven't quite settled down yet, but I'd like to convince
you that you needn't wait. For all bytes input, you should use the
(new) buffer API,i. e. PyObject_GetBuffer() and
PyObject_ReleaseBuffer() (grep for usage examples if they aren't
sufficiently documented in the docs or in PEP 3118). For stuff that
returns bytes, you can either use PyBytes_FromStringAndSize() -- which
is the 3.0a1 recommended best practice (returning a mutable bytes
object) or PyString_FromStringAndSize() -- which will be the 3.0a2 way
of returning an immutable bytes object). Since they have the same
signature there's very little to worry about having to change this
around later.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list