Skip to content

Commit f61de0d

Browse files
[3.12] gh-117903: Clarify that the staticmethod descriptor is callable (GH-117925) (GH-118509)
(cherry picked from commit b337248) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent c48e0ef commit f61de0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/functions.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -1723,8 +1723,9 @@ are always available. They are listed here in alphabetical order.
17231723
:ref:`function` for details.
17241724

17251725
A static method can be called either on the class (such as ``C.f()``) or on
1726-
an instance (such as ``C().f()``). Moreover, they can be called as regular
1727-
functions (such as ``f()``).
1726+
an instance (such as ``C().f()``).
1727+
Moreover, the static method :term:`descriptor` is also callable, so it can
1728+
be used in the class definition (such as ``f()``).
17281729

17291730
Static methods in Python are similar to those found in Java or C++. Also, see
17301731
:func:`classmethod` for a variant that is useful for creating alternate class

0 commit comments

Comments
 (0)