Skip to content

Commit

Permalink
pythongh-102595: Document PyObject_Format c-api function (pythonGH-…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored and Fidget-Spinner committed Mar 27, 2023
1 parent 6776fb1 commit 05078fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05078fd

Please sign in to comment.