Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01452af

Browse files
Issue #28750: Fixed docs of of unicode-escape an raw-unicode-escape C API.
Patch by Xiang Zhang.
2 parents 0e7dbe9 + cf36835 commit 01452af

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Doc/c-api/unicode.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,16 +1296,15 @@ These are the "Unicode Escape" codec APIs:
12961296
12971297
.. c:function:: PyObject* PyUnicode_AsUnicodeEscapeString(PyObject *unicode)
12981298
1299-
Encode a Unicode object using Unicode-Escape and return the result as Python
1300-
string object. Error handling is "strict". Return *NULL* if an exception was
1299+
Encode a Unicode object using Unicode-Escape and return the result as a
1300+
bytes object. Error handling is "strict". Return *NULL* if an exception was
13011301
raised by the codec.
13021302
13031303
13041304
.. c:function:: PyObject* PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s, Py_ssize_t size)
13051305
13061306
Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-Escape and
1307-
return a Python string object. Return *NULL* if an exception was raised by the
1308-
codec.
1307+
return a bytes object. Return *NULL* if an exception was raised by the codec.
13091308
13101309
.. deprecated-removed:: 3.3 4.0
13111310
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
@@ -1328,16 +1327,15 @@ These are the "Raw Unicode Escape" codec APIs:
13281327
.. c:function:: PyObject* PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode)
13291328
13301329
Encode a Unicode object using Raw-Unicode-Escape and return the result as
1331-
Python string object. Error handling is "strict". Return *NULL* if an exception
1330+
a bytes object. Error handling is "strict". Return *NULL* if an exception
13321331
was raised by the codec.
13331332
13341333
13351334
.. c:function:: PyObject* PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s, \
13361335
Py_ssize_t size, const char *errors)
13371336
13381337
Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-Escape
1339-
and return a Python string object. Return *NULL* if an exception was raised by
1340-
the codec.
1338+
and return a bytes object. Return *NULL* if an exception was raised by the codec.
13411339
13421340
.. deprecated-removed:: 3.3 4.0
13431341
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using

0 commit comments

Comments
 (0)