]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103883: Doc: Move PyUnicode_FromObject doc (GH-103913)
authorInada Naoki <songofacandy@gmail.com>
Thu, 27 Apr 2023 06:05:35 +0000 (15:05 +0900)
committerGitHub <noreply@github.com>
Thu, 27 Apr 2023 06:05:35 +0000 (15:05 +0900)
This API is one of Unicode creator APIs.
This APIs should not be placed in PEP 393 deprecated APIs.

Fixes: gh-103883
(cherry picked from commit ce2383ec6665850a1bdffad388876481b6f3205f)

Doc/c-api/unicode.rst

index e72f151510cbde9b78a241907ef412431969c020..12f95a2e8a39d08c6c5a9653035be2c6ebc091e7 100644 (file)
@@ -572,6 +572,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)
 
@@ -752,15 +761,6 @@ Extension modules can continue using them, as they will not be removed in Python
       :c:func:`PyUnicode_GET_LENGTH`.
 
 
-.. 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
 """""""""""""""