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
15ccc4fa
Commit
15ccc4fa
authored
5 years ago
by
Raymond Hettinger
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38255: super() can search attributes as well as methods (GH-16368)
Improvement suggested by Géry Ogam.
parent
00508a74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Doc/library/functions.rst
Doc/library/functions.rst
+4
-0
No files found.
Doc/library/functions.rst
View file @
15ccc4fa
...
...
@@ -1637,6 +1637,10 @@ are always available. They are listed here in alphabetical order.
super().method(arg) # This does the same thing as:
# super(C, self).method(arg)
In addition to method lookups, :func:`super` also works for attribute
lookups. One possible use case for this is calling :term:`descriptor`\s
in a parent or sibling class.
Note that :func:`super` is implemented as part of the binding process for
explicit dotted attribute lookups such as ``super().__getitem__(name)``.
It does so by implementing its own :meth:`__getattribute__` method for searching
...
...
This diff is collapsed.
Click to expand it.
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