]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-46236: Add missing PyUnicode_FromOrdinal() doc (#132040) (#132521)
authorVictor Stinner <vstinner@python.org>
Mon, 14 Apr 2025 16:48:40 +0000 (18:48 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Apr 2025 16:48:40 +0000 (16:48 +0000)
gh-46236: Add missing PyUnicode_FromOrdinal() doc (#132040)

(cherry picked from commit 8768df2fe94a8444baff47a5b8c7414a2118731a)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
Doc/c-api/unicode.rst
Doc/data/refcounts.dat

index a62a4e93a3d13d009d9102be0a11b1b97e2b4e3d..d9b6b1f8b93b3197893e78e63f7bc888a12672dc 100644 (file)
@@ -589,6 +589,14 @@ APIs:
    Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
 
 
+.. c:function:: PyObject* PyUnicode_FromOrdinal(int ordinal)
+
+   Create a Unicode Object from the given Unicode code point *ordinal*.
+
+   The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is
+   raised in the case it is not.
+
+
 .. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
                                const char *encoding, const char *errors)
 
index 987aa2d60dac8c7880c931b60eceb7b2e9409461..964914aa714f095f7eed42204edc0bf5fc8f1822 100644 (file)
@@ -2756,6 +2756,9 @@ PyUnicode_FromFormatV:PyObject*::+1:
 PyUnicode_FromFormatV:const char*:format::
 PyUnicode_FromFormatV:va_list:args::
 
+PyUnicode_FromOrdinal:PyObject*::+1:
+PyUnicode_FromOrdinal:int:ordinal::
+
 PyUnicode_GetDefaultEncoding:const char*:::
 PyUnicode_GetDefaultEncoding::void::