]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43682: @staticmethod inherits attributes (GH-25268)
authorVictor Stinner <vstinner@python.org>
Fri, 9 Apr 2021 15:51:22 +0000 (17:51 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Apr 2021 15:51:22 +0000 (17:51 +0200)
commit507a574de31a1bd7fed8ba4f04afa285d985109b
tree44fb249533ae98698ef7736bc050df450f9a07e1
parent150af7543214e1541fa582374502ac1cd70e8eb4
bpo-43682: @staticmethod inherits attributes (GH-25268)

Static methods (@staticmethod) and class methods (@classmethod) now
inherit the method attributes (__module__, __name__, __qualname__,
__doc__, __annotations__) and have a new __wrapped__ attribute.

Changes:

* Add a repr() method to staticmethod and classmethod types.
* Add tests on the @classmethod decorator.
Doc/library/functions.rst
Doc/whatsnew/3.10.rst
Lib/test/test_decorators.py
Lib/test/test_descr.py
Lib/test/test_pydoc.py
Lib/test/test_reprlib.py
Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst [new file with mode: 0644]
Objects/funcobject.c