Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-43427: Separate the method overview from static method specifics #24787

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ If you have ever wondered where *self* comes from in regular methods or where
*cls* comes from in class methods, this is it!


Static methods
--------------
Other kinds of methods
----------------------

Non-data descriptors provide a simple mechanism for variations on the usual
patterns of binding functions into methods.
Expand All @@ -1163,6 +1163,10 @@ This chart summarizes the binding and its two most useful variants:
| classmethod | f(type(obj), \*args) | f(cls, \*args) |
+-----------------+----------------------+------------------+


Static methods
--------------

Static methods return the underlying function without changes. Calling either
``c.f`` or ``C.f`` is the equivalent of a direct lookup into
``object.__getattribute__(c, "f")`` or ``object.__getattribute__(C, "f")``. As a
Expand Down