summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-03-14 22:23:00 (GMT)
committerGitHub <noreply@github.com>2024-03-14 22:23:00 (GMT)
commit7bbb9b57e67057d5ca3b7e3a434527fb3fcf5a2b (patch)
tree5f09547613d22804329cac09199b629f3182b4db /Doc/c-api
parent5f52d20a93908196f74271db8437cc1ba7e1e262 (diff)
downloadcpython-7bbb9b57e67057d5ca3b7e3a434527fb3fcf5a2b.zip
cpython-7bbb9b57e67057d5ca3b7e3a434527fb3fcf5a2b.tar.gz
cpython-7bbb9b57e67057d5ca3b7e3a434527fb3fcf5a2b.tar.bz2
gh-111696, PEP 737: Add %T and %N to PyUnicode_FromFormat() (#116839)
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/unicode.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 666ffe8..78eec14 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -518,6 +518,26 @@ APIs:
- :c:expr:`PyObject*`
- The result of calling :c:func:`PyObject_Repr`.
+ * - ``T``
+ - :c:expr:`PyObject*`
+ - Get the fully qualified name of an object type;
+ call :c:func:`PyType_GetFullyQualifiedName`.
+
+ * - ``T#``
+ - :c:expr:`PyObject*`
+ - Similar to ``T`` format, but use a colon (``:``) as separator between
+ the module name and the qualified name.
+
+ * - ``N``
+ - :c:expr:`PyTypeObject*`
+ - Get the fully qualified name of a type;
+ call :c:func:`PyType_GetFullyQualifiedName`.
+
+ * - ``N#``
+ - :c:expr:`PyTypeObject*`
+ - Similar to ``N`` format, but use a colon (``:``) as separator between
+ the module name and the qualified name.
+
.. note::
The width formatter unit is number of characters rather than bytes.
The precision formatter unit is number of bytes or :c:type:`wchar_t`
@@ -553,6 +573,9 @@ APIs:
In previous versions it caused all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
+ .. versionchanged:: 3.13
+ Support for ``%T``, ``%T#``, ``%N`` and ``%N#`` formats added.
+
.. c:function:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)