gh-117903: Clarify that the staticmethod descriptor is callable (GH-117925)

This commit is contained in:
Serhiy Storchaka 2024-05-02 16:56:33 +03:00 committed by GitHub
parent 7d2ffada0a
commit b3372481b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -1733,8 +1733,9 @@ are always available. They are listed here in alphabetical order.
:ref:`function` for details.
A static method can be called either on the class (such as ``C.f()``) or on
an instance (such as ``C().f()``). Moreover, they can be called as regular
functions (such as ``f()``).
an instance (such as ``C().f()``).
Moreover, the static method :term:`descriptor` is also callable, so it can
be used in the class definition (such as ``f()``).
Static methods in Python are similar to those found in Java or C++. Also, see
:func:`classmethod` for a variant that is useful for creating alternate class