diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-05-04 15:06:34 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-05-04 15:06:34 (GMT) |
commit | c228e96726129e20519a2016075fca3dc9fdcd30 (patch) | |
tree | bf6fca50fa7f3fd47fdfe20fbed1baf2d65f2585 /Doc/c-api | |
parent | 28faf03d4474d184b30a8013c70845b6600d456d (diff) | |
download | cpython-c228e96726129e20519a2016075fca3dc9fdcd30.zip cpython-c228e96726129e20519a2016075fca3dc9fdcd30.tar.gz cpython-c228e96726129e20519a2016075fca3dc9fdcd30.tar.bz2 |
#16518: use "bytes-like object" throughout the docs.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/arg.rst | 13 | ||||
-rw-r--r-- | Doc/c-api/bytearray.rst | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index b28aa5f..b4efbf0 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -70,8 +70,7 @@ Unless otherwise stated, buffers are not NUL-terminated. as *converter*. ``s*`` (:class:`str`, :class:`bytes`, :class:`bytearray` or buffer compatible object) [Py_buffer] - This format accepts Unicode objects as well as objects supporting the - buffer protocol. + This format accepts Unicode objects as well as :term:`bytes-like object`\ s. It fills a :c:type:`Py_buffer` structure provided by the caller. In this case the resulting C string may contain embedded NUL bytes. Unicode objects are converted to C strings using ``'utf-8'`` encoding. @@ -101,14 +100,14 @@ Unless otherwise stated, buffers are not NUL-terminated. contain embedded NUL bytes; if it does, a :exc:`TypeError` exception is raised. -``y*`` (:class:`bytes`, :class:`bytearray` or buffer compatible object) [Py_buffer] - This variant on ``s*`` doesn't accept Unicode objects, only objects - supporting the buffer protocol. **This is the recommended way to accept +``y*`` (:class:`bytes`, :class:`bytearray` or :term:`bytes-like object`) [Py_buffer] + This variant on ``s*`` doesn't accept Unicode objects, only + :term:`bytes-like object`\ s. **This is the recommended way to accept binary data.** ``y#`` (:class:`bytes`) [const char \*, int] - This variant on ``s#`` doesn't accept Unicode objects, only bytes-like - objects. + This variant on ``s#`` doesn't accept Unicode objects, only :term:`bytes-like + object`\ s. ``S`` (:class:`bytes`) [PyBytesObject \*] Requires that the Python object is a :class:`bytes` object, without diff --git a/Doc/c-api/bytearray.rst b/Doc/c-api/bytearray.rst index 95ded96..8202205 100644 --- a/Doc/c-api/bytearray.rst +++ b/Doc/c-api/bytearray.rst @@ -40,7 +40,7 @@ Direct API functions .. c:function:: PyObject* PyByteArray_FromObject(PyObject *o) Return a new bytearray object from any object, *o*, that implements the - buffer protocol. + :ref:`buffer protocol <bufferobjects>`. .. XXX expand about the buffer protocol, at least somewhere |