gh-96526: Clarify format and __format__ docstrings (gh-96648)

This commit is contained in:
Michael 2022-10-04 00:28:02 +02:00 committed by GitHub
parent 0ea8b925d0
commit 07b8e85d0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 16 deletions

View file

@ -5824,11 +5824,13 @@ object.__format__
/
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
[clinic start generated code]*/
static PyObject *
object___format___impl(PyObject *self, PyObject *format_spec)
/*[clinic end generated code: output=34897efb543a974b input=7c3b3bc53a6fb7fa]*/
/*[clinic end generated code: output=34897efb543a974b input=b94d8feb006689ea]*/
{
/* Issue 7994: If we're converting to a string, we
should reject format specifications */