Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e7fb7008
Commit
e7fb7008
authored
Apr 14, 2013
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The im_class of unbound class methods is actually not the same as im_self.
parent
d4c45a91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+4
-5
No files found.
Doc/reference/datamodel.rst
View file @
e7fb7008
...
...
@@ -623,9 +623,8 @@ Callable types
single: im_self (method attribute)
When a user-defined method object is created by retrieving a class method object
from a class or instance, its :attr:`im_self` attribute is the class itself (the
same as the :attr:`im_class` attribute), and its :attr:`im_func` attribute is
the function object underlying the class method.
from a class or instance, its :attr:`im_self` attribute is the class itself, and
its :attr:`im_func` attribute is the function object underlying the class method.
When an unbound user-defined method object is called, the underlying function
(:attr:`im_func`) is called, with the restriction that the first argument must
...
...
@@ -797,8 +796,8 @@ Classes
associated class is either :class:`C` or one of its base classes, it is
transformed into an unbound user-defined method object whose :attr:`im_class`
attribute is :class:`C`. When it would yield a class method object, it is
transformed into a bound user-defined method object whose
:attr:`im_class`
and :attr:`im_self` attributes are both
:class:`C`. When it would yield a
transformed into a bound user-defined method object whose
:attr:`im_self` attribute is
:class:`C`. When it would yield a
static method object, it is transformed into the object wrapped by the static
method object. See section :ref:`descriptors` for another way in which
attributes retrieved from a class may differ from those actually contained in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment