]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-47007: [doc] `str` special method lookup (GH-31863)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 5 Apr 2022 02:59:04 +0000 (19:59 -0700)
committerGitHub <noreply@github.com>
Tue, 5 Apr 2022 02:59:04 +0000 (19:59 -0700)
Clarify the `str()` docs to point out that `object.__str__()`
follows special method lookup.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit bb86d1d9fbd1888524e04475383f4ea764277f67)

Co-authored-by: Vanshaj Singhania <8797467+itsvs@users.noreply.github.com>
Doc/library/stdtypes.rst

index b10909d81af0a98118d5c205aa1d703dad758dc2..4be4d1daa831d82a9023c3b9a4044afcfbb7e257 100644 (file)
@@ -1448,7 +1448,8 @@ multiple fragments.
    depends on whether *encoding* or *errors* is given, as follows.
 
    If neither *encoding* nor *errors* is given, ``str(object)`` returns
-   :meth:`object.__str__() <object.__str__>`, which is the "informal" or nicely
+   :meth:`type(object).__str__(object) <object.__str__>`,
+   which is the "informal" or nicely
    printable string representation of *object*.  For string objects, this is
    the string itself.  If *object* does not have a :meth:`~object.__str__`
    method, then :func:`str` falls back to returning