From: Inada Naoki Date: Thu, 27 Apr 2023 05:53:11 +0000 (+0900) Subject: gh-103883: Doc: Move PyUnicode_FromObject doc (#103913) X-Git-Tag: v3.12.0b1~396 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce2383ec6665850a1bdffad388876481b6f3205f;p=thirdparty%2FPython%2Fcpython.git gh-103883: Doc: Move PyUnicode_FromObject doc (#103913) This API is one of Unicode creator APIs. --- diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index f062f14e9a75..ab3a2e274d93 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -509,6 +509,15 @@ APIs: arguments. +.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj) + + Copy an instance of a Unicode subtype to a new true Unicode object if + necessary. If *obj* is already a true Unicode object (not a subtype), + return the reference with incremented refcount. + + Objects other than Unicode or its subtypes will cause a :exc:`TypeError`. + + .. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \ const char *encoding, const char *errors) @@ -616,15 +625,6 @@ APIs: .. versionadded:: 3.3 -.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj) - - Copy an instance of a Unicode subtype to a new true Unicode object if - necessary. If *obj* is already a true Unicode object (not a subtype), - return the reference with incremented refcount. - - Objects other than Unicode or its subtypes will cause a :exc:`TypeError`. - - Locale Encoding """""""""""""""