summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-05-04 15:07:12 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-05-04 15:07:12 (GMT)
commit4cfc0b5411354323433031b5e03862def2f00234 (patch)
tree63cf0326905fcd23cd4050dee6fb01440486b853 /Doc/c-api
parent4e59af7abddc7c43a6f52b571fcd65fc55e5f861 (diff)
parentc228e96726129e20519a2016075fca3dc9fdcd30 (diff)
downloadcpython-4cfc0b5411354323433031b5e03862def2f00234.zip
cpython-4cfc0b5411354323433031b5e03862def2f00234.tar.gz
cpython-4cfc0b5411354323433031b5e03862def2f00234.tar.bz2
#16518: merge with 3.3.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/arg.rst13
-rw-r--r--Doc/c-api/bytearray.rst2
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