@@ -65,19 +65,20 @@ Unless otherwise stated, buffers are not NUL-terminated.
6565 :exc: `UnicodeError ` is raised.
6666
6767 .. note ::
68- This format does not accept bytes-like objects. If you want to accept
68+ This format does not accept :term: `bytes-like objects
69+ <bytes-like object> `. If you want to accept
6970 filesystem paths and convert them to C character strings, it is
7071 preferable to use the ``O& `` format with :c:func: `PyUnicode_FSConverter `
7172 as *converter *.
7273
73- ``s* `` (:class: `str `, :class : `bytes `, :class: ` bytearray ` or buffer compatible object) [Py_buffer]
74- This format accepts Unicode objects as well as :term: ` bytes-like object ` \ s .
74+ ``s* `` (:class: `str ` or :term : `bytes-like object ` ) [Py_buffer]
75+ This format accepts Unicode objects as well as bytes-like objects .
7576 It fills a :c:type: `Py_buffer ` structure provided by the caller.
7677 In this case the resulting C string may contain embedded NUL bytes.
7778 Unicode objects are converted to C strings using ``'utf-8' `` encoding.
7879
79- ``s# `` (:class: `str `, :class : `bytes ` or read-only buffer compatible object) [const char \* , int or :c:type: `Py_ssize_t `]
80- Like ``s* ``, except that it doesn't accept mutable buffer -like objects
80+ ``s# `` (:class: `str `, read-only :term : `bytes-like object ` ) [const char \* , int or :c:type: `Py_ssize_t `]
81+ Like ``s* ``, except that it doesn't accept mutable bytes -like objects
8182 such as :class: `bytearray `. The result is stored into two C variables,
8283 the first one a pointer to a C string, the second one its length.
8384 The string may contain embedded null bytes. Unicode objects are converted
@@ -87,28 +88,28 @@ Unless otherwise stated, buffers are not NUL-terminated.
8788 Like ``s ``, but the Python object may also be ``None ``, in which case the C
8889 pointer is set to *NULL *.
8990
90- ``z* `` (:class: `str `, :class : `bytes `, :class: ` bytearray `, buffer compatible object or ``None ``) [Py_buffer]
91+ ``z* `` (:class: `str `, :term : `bytes-like object ` or ``None ``) [Py_buffer]
9192 Like ``s* ``, but the Python object may also be ``None ``, in which case the
9293 ``buf `` member of the :c:type: `Py_buffer ` structure is set to *NULL *.
9394
94- ``z# `` (:class: `str `, :class : `bytes `, read-only buffer compatible object or ``None ``) [const char \* , int]
95+ ``z# `` (:class: `str `, read-only :term : `bytes-like object ` or ``None ``) [const char \* , int]
9596 Like ``s# ``, but the Python object may also be ``None ``, in which case the C
9697 pointer is set to *NULL *.
9798
98- ``y `` (:class : `bytes `) [const char \* ]
99+ ``y `` (read-only :term : `bytes-like object `) [const char \* ]
99100 This format converts a bytes-like object to a C pointer to a character
100101 string; it does not accept Unicode objects. The bytes buffer must not
101102 contain embedded NUL bytes; if it does, a :exc: `TypeError `
102103 exception is raised.
103104
104- ``y* `` (:class: ` bytes `, :class: ` bytearray ` or : term: `bytes-like object `) [Py_buffer]
105+ ``y* `` (:term: `bytes-like object `) [Py_buffer]
105106 This variant on ``s* `` doesn't accept Unicode objects, only
106- :term: ` bytes-like object ` \ s . **This is the recommended way to accept
107+ bytes-like objects . **This is the recommended way to accept
107108 binary data. **
108109
109- ``y# `` (:class : `bytes `) [const char \* , int]
110- This variant on ``s# `` doesn't accept Unicode objects, only :term: ` bytes-like
111- object ` \ s .
110+ ``y# `` (read-only :term : `bytes-like object `) [const char \* , int]
111+ This variant on ``s# `` doesn't accept Unicode objects, only bytes-like
112+ objects .
112113
113114``S `` (:class: `bytes `) [PyBytesObject \* ]
114115 Requires that the Python object is a :class: `bytes ` object, without
0 commit comments