diff options
author | Victor Stinner <vstinner@python.org> | 2021-04-09 15:51:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 15:51:22 (GMT) |
commit | 507a574de31a1bd7fed8ba4f04afa285d985109b (patch) | |
tree | 44fb249533ae98698ef7736bc050df450f9a07e1 /Misc | |
parent | 150af7543214e1541fa582374502ac1cd70e8eb4 (diff) | |
download | cpython-507a574de31a1bd7fed8ba4f04afa285d985109b.zip cpython-507a574de31a1bd7fed8ba4f04afa285d985109b.tar.gz cpython-507a574de31a1bd7fed8ba4f04afa285d985109b.tar.bz2 |
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst new file mode 100644 index 0000000..ab5873e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst @@ -0,0 +1,5 @@ +Static methods (:func:`@staticmethod <staticmethod>`) and class methods +(:func:`@classmethod <classmethod>`) now inherit the method attributes +(``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, +``__annotations__``) and have a new ``__wrapped__`` attribute. +Patch by Victor Stinner. |