We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PyObject_Format
1 parent 7f760c2 commit 910a64eCopy full SHA for 910a64e
Doc/c-api/object.rst
@@ -179,6 +179,15 @@ Object Protocol
179
If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
180
will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`.
181
182
+.. c:function:: PyObject* PyObject_Format(PyObject *obj, PyObject *format_spec)
183
+
184
+ Format *obj* using *format_spec*. This is equivalent to the Python
185
+ expression ``format(obj, format_spec)``.
186
187
+ *format_spec* may be ``NULL``. In this case the call is equivalent
188
+ to ``format(obj)``.
189
+ Returns the formatted string on success, ``NULL`` on failure.
190
191
.. c:function:: PyObject* PyObject_Repr(PyObject *o)
192
193
.. index:: builtin: repr
0 commit comments