From 91906924e3e6e849053ae43e56073b05f38ad0fe Mon Sep 17 00:00:00 2001 From: James Roy Date: Thu, 3 Apr 2025 10:04:02 +0800 Subject: [PATCH 1/3] Add missing PyUnicode_FromOrdinal() doc --- Doc/c-api/unicode.rst | 8 ++++++++ Doc/data/refcounts.dat | 3 +++ 2 files changed, 11 insertions(+) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 31063962ae51c5..beb67524482ea4 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -596,6 +596,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 case it is not. + + .. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \ const char *encoding, const char *errors) diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 14629fbff0fb78..47b417eed6efda 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1: PyUnicode_FromFormatV:const char*:format:: PyUnicode_FromFormatV:va_list:args:: +PyUnicode_FromOrdinal:PyObject*::+1: +PyUnicode_FromOrdinal:int:ordinal:: + PyUnicode_Append:void::: PyUnicode_Append:PyObject**:p_left:0: PyUnicode_Append:PyObject*:right:: From 06041b42630cb031e936bf81f55259128a39eb0a Mon Sep 17 00:00:00 2001 From: James Roy Date: Fri, 11 Apr 2025 12:48:08 +0800 Subject: [PATCH 2/3] Change doc --- Doc/c-api/unicode.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index beb67524482ea4..c7dc025a536920 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -600,8 +600,8 @@ APIs: Create a Unicode Object from the given Unicode code point *ordinal*. - The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is - raised in case it is not. + 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, \ From f429c1709acdb818bc0128472708af27ae31f739 Mon Sep 17 00:00:00 2001 From: "RUANG (James Roy)" Date: Fri, 11 Apr 2025 13:30:46 +0800 Subject: [PATCH 3/3] Change doc --- Doc/c-api/unicode.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index c7dc025a536920..91ea59ef4de43e 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -600,7 +600,7 @@ APIs: Create a Unicode Object from the given Unicode code point *ordinal*. - The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is + The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in the case it is not.