Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1cd57b9

Browse files
[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 commitc68cb8e)Co-authored-by: Thomas Grainger <tagrain@gmail.com>
1 parentc8f5ca6 commit1cd57b9

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)

[8]ページ先頭

©2009-2025 Movatter.jp