From 1cd57b99378043f3c74be548dedd09099d2baba5 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:48:29 +0200 Subject: [PATCH] [3.12] Remove outdated note about instance methods from datamodel.rst (GH-122471) (#122480) Remove outdated note about instance methods from datamodel.rst (GH-122471) (cherry picked from commit c68cb8e0c9bd75ded25578c2fba6469e55a06e93) Co-authored-by: Thomas Grainger --- Doc/reference/datamodel.rst | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 6a889ca8475..25ca94fd5a8 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -727,14 +727,7 @@ When an instance method object is derived from a :class:`classmethod` object, th itself, so that calling either ``x.f(1)`` or ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is the underlying function. -Note that the transformation from :ref:`function object ` -to instance method -object happens each time the attribute is retrieved from the instance. In -some cases, a fruitful optimization is to assign the attribute to a local -variable and call that local variable. Also notice that this -transformation only happens for user-defined functions; other callable -objects (and all non-callable objects) are retrieved without -transformation. It is also important to note that user-defined functions +It is important to note that user-defined functions which are attributes of a class instance are not converted to bound methods; this *only* happens when the function is an attribute of the class.