diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2021-03-13 21:46:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 21:46:32 (GMT) |
commit | f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a (patch) | |
tree | 63a7c8643ce07844c3f9419d56cd9958e41c893d /Doc/howto | |
parent | f917efccf8d5aa2b8315d2a832a520339e668187 (diff) | |
download | cpython-f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a.zip cpython-f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a.tar.gz cpython-f00e82f8b87c96ff76d6f768fa7a29cbd86eec6a.tar.bz2 |
bpo-43427: Separte the method overview from the static method specifics. (GH-24787)
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/descriptor.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index 94a8b4e..94aadd6 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -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. @@ -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 |