summaryrefslogtreecommitdiffstats
path: root/Objects/clinic
diff options
context:
space:
mode:
authorMichael <216956+mikez@users.noreply.github.com>2022-10-03 22:28:02 (GMT)
committerGitHub <noreply@github.com>2022-10-03 22:28:02 (GMT)
commit07b8e85d0e29bc59a7a7d7d662db500c93980edb (patch)
treed833d08cdd4c706ddc5c5ecb02d4129c6294636a /Objects/clinic
parent0ea8b925d096629852d1045c2c53ff6ad63199cc (diff)
downloadcpython-07b8e85d0e29bc59a7a7d7d662db500c93980edb.zip
cpython-07b8e85d0e29bc59a7a7d7d662db500c93980edb.tar.gz
cpython-07b8e85d0e29bc59a7a7d7d662db500c93980edb.tar.bz2
gh-96526: Clarify format and __format__ docstrings (gh-96648)
Diffstat (limited to 'Objects/clinic')
-rw-r--r--Objects/clinic/longobject.c.h5
-rw-r--r--Objects/clinic/typeobject.c.h6
2 files changed, 7 insertions, 4 deletions
diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h
index 1cf5b43..dde4909 100644
--- a/Objects/clinic/longobject.c.h
+++ b/Objects/clinic/longobject.c.h
@@ -88,7 +88,8 @@ int___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored))
PyDoc_STRVAR(int___format____doc__,
"__format__($self, format_spec, /)\n"
"--\n"
-"\n");
+"\n"
+"Convert to a string according to format_spec.");
#define INT___FORMAT___METHODDEF \
{"__format__", (PyCFunction)int___format__, METH_O, int___format____doc__},
@@ -466,4 +467,4 @@ skip_optional_kwonly:
exit:
return return_value;
}
-/*[clinic end generated code: output=b29b4afc65e3290e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bf6074ecf2f32cf4 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h
index f286429..dc9746a 100644
--- a/Objects/clinic/typeobject.c.h
+++ b/Objects/clinic/typeobject.c.h
@@ -204,7 +204,9 @@ PyDoc_STRVAR(object___format____doc__,
"__format__($self, format_spec, /)\n"
"--\n"
"\n"
-"Default object formatter.");
+"Default object formatter.\n"
+"\n"
+"Return str(self) if format_spec is empty. Raise TypeError otherwise.");
#define OBJECT___FORMAT___METHODDEF \
{"__format__", (PyCFunction)object___format__, METH_O, object___format____doc__},
@@ -267,4 +269,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return object___dir___impl(self);
}
-/*[clinic end generated code: output=3312f873c970bfd1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d2fc52440a89f2fa input=a9049054013a1b77]*/