[3.11] gh-101100: Improve documentation for attributes on instance methods (GH-112832) (#112873)

gh-101100: Improve documentation for attributes on instance methods (GH-112832)
(cherry picked from commit ed21d0c1f4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-12-08 14:25:05 +01:00 committed by GitHub
parent 5a11bcbf71
commit 161cfd0dda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 40 deletions

View file

@ -768,8 +768,10 @@ data from a string buffer instead, and pass it as an argument.
or arithmetic operators, and assigning such a "pseudo-file" to sys.stdin will
not cause the interpreter to read further input from it.)
Instance method objects have attributes, too: ``m.__self__`` is the instance
object with the method :meth:`!m`, and ``m.__func__`` is the function object
:ref:`Instance method objects <instance-methods>` have attributes, too:
:attr:`m.__self__ <method.__self__>` is the instance
object with the method :meth:`!m`, and :attr:`m.__func__ <method.__func__>` is
the :ref:`function object <user-defined-funcs>`
corresponding to the method.