[3.11] gh-102595: Document PyObject_Format c-api function (GH-102596) (GH-102879)

(cherry picked from commit 910a64e301)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Def: 5ffdaf748d/Include/abstract.hGH-L389

Automerge-Triggered-By: GH:encukou
This commit is contained in:
Miss Islington (bot) 2023-03-22 02:32:02 -07:00 committed by GitHub
parent 1eb9b24929
commit a7a373e1c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,6 +179,15 @@ Object Protocol
If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`.
.. c:function:: PyObject* PyObject_Format(PyObject *obj, PyObject *format_spec)
Format *obj* using *format_spec*. This is equivalent to the Python
expression ``format(obj, format_spec)``.
*format_spec* may be ``NULL``. In this case the call is equivalent
to ``format(obj)``.
Returns the formatted string on success, ``NULL`` on failure.
.. c:function:: PyObject* PyObject_Repr(PyObject *o)
.. index:: builtin: repr