@@ -84,8 +84,8 @@ Python:
8484 is exposed to Python code as ``str ``.
8585
8686
87- The following APIs are really C macros and can be used to do fast checks and to
88- access internal read-only data of Unicode objects:
87+ The following APIs are C macros and static inlined functions for fast checks and
88+ access to internal read-only data of Unicode objects:
8989
9090.. c :function :: int PyUnicode_Check (PyObject *o)
9191
@@ -168,20 +168,21 @@ access internal read-only data of Unicode objects:
168168 .. versionadded:: 3.3
169169
170170
171- .. c:function:: void PyUnicode_WRITE(int kind, void *data, Py_ssize_t index , \
172- Py_UCS4 value)
171+ .. c:function:: void PyUnicode_WRITE(unsigned int kind, void *data, \
172+ Py_ssize_t index, Py_UCS4 value)
173173
174174 Write into a canonical representation *data * (as obtained with
175- :c:func: `PyUnicode_DATA `). This macro does not do any sanity checks and is
175+ :c:func: `PyUnicode_DATA `). This function performs no sanity checks, and is
176176 intended for usage in loops. The caller should cache the *kind* value and
177- *data* pointer as obtained from other macro calls. *index* is the index in
177+ *data* pointer as obtained from other calls. *index* is the index in
178178 the string (starts at 0) and *value* is the new code point value which should
179179 be written to that location.
180180
181181 .. versionadded:: 3.3
182182
183183
184- .. c:function:: Py_UCS4 PyUnicode_READ(int kind, void *data, Py_ssize_t index)
184+ .. c:function:: Py_UCS4 PyUnicode_READ(unsigned int kind, void *data, \
185+ Py_ssize_t index)
185186
186187 Read a code point from a canonical representation *data * (as obtained with
187188 :c:func: `PyUnicode_DATA `). No checks or ready calls are performed.
@@ -198,7 +199,7 @@ access internal read-only data of Unicode objects:
198199 .. versionadded :: 3.3
199200
200201
201- .. c :macro :: PyUnicode_MAX_CHAR_VALUE(o)
202+ .. c :function :: Py_UCS4 PyUnicode_MAX_CHAR_VALUE (PyObject * o)
202203
203204 Return the maximum code point that is suitable for creating another string
204205 based on *o *, which must be in the "canonical" representation. This is
@@ -239,7 +240,7 @@ access internal read-only data of Unicode objects:
239240 a Unicode object (not checked).
240241
241242 .. versionchanged:: 3.3
242- This macro is now inefficient -- because in many cases the
243+ This function is now inefficient -- because in many cases the
243244 :c:type:`Py_UNICODE` representation does not exist and needs to be created
244245 -- and can fail (return ``NULL `` with an exception set). Try to port the
245246 code to use the new :c:func:`PyUnicode_nBYTE_DATA` macros or use
@@ -642,8 +643,8 @@ APIs:
642643.. c:function:: Py_UCS4 PyUnicode_ReadChar(PyObject *unicode, Py_ssize_t index)
643644
644645 Read a character from a string. This function checks that *unicode * is a
645- Unicode object and the index is not out of bounds, in contrast to the macro
646- version :c:func: `PyUnicode_READ_CHAR `.
646+ Unicode object and the index is not out of bounds, in contrast to
647+ :c:func: `PyUnicode_READ_CHAR `, which performs no error checking .
647648
648649 .. versionadded :: 3.3
649650
0 commit comments