bpo-43682: Make staticmethod objects callable (GH-25117)

Static methods (@staticmethod) are now callable as regular functions.
This commit is contained in:
Victor Stinner 2021-04-12 00:21:22 +02:00 committed by GitHub
parent 53114ffef1
commit 553ee2781a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 14 deletions

View file

@ -1132,9 +1132,8 @@ Internal types
around any other object, usually a user-defined method object. When a static
method object is retrieved from a class or a class instance, the object actually
returned is the wrapped object, which is not subject to any further
transformation. Static method objects are not themselves callable, although the
objects they wrap usually are. Static method objects are created by the built-in
:func:`staticmethod` constructor.
transformation. Static method objects are also callable. Static method
objects are created by the built-in :func:`staticmethod` constructor.
Class method objects
A class method object, like a static method object, is a wrapper around another