Skip to content

Commit e65aea9

Browse files
[3.13] Remove outdated note about instance methods from datamodel.rst (GH-122471) (#122479)
Remove outdated note about instance methods from datamodel.rst (GH-122471) (cherry picked from commit c68cb8e) Co-authored-by: Thomas Grainger <[email protected]>
1 parent 7a90d94 commit e65aea9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Doc/reference/datamodel.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -727,14 +727,7 @@ When an instance method object is derived from a :class:`classmethod` object, th
727727
itself, so that calling either ``x.f(1)`` or ``C.f(1)`` is equivalent to
728728
calling ``f(C,1)`` where ``f`` is the underlying function.
729729

730-
Note that the transformation from :ref:`function object <user-defined-funcs>`
731-
to instance method
732-
object happens each time the attribute is retrieved from the instance. In
733-
some cases, a fruitful optimization is to assign the attribute to a local
734-
variable and call that local variable. Also notice that this
735-
transformation only happens for user-defined functions; other callable
736-
objects (and all non-callable objects) are retrieved without
737-
transformation. It is also important to note that user-defined functions
730+
It is important to note that user-defined functions
738731
which are attributes of a class instance are not converted to bound
739732
methods; this *only* happens when the function is an attribute of the
740733
class.

0 commit comments

Comments
 (0)