Issue 5982: Classmethod and staticmethod expose wrapped function with __func__.
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 1bb2092..acd662c 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -775,6 +775,11 @@
 	return 0;
 }
 
+static PyMemberDef cm_memberlist[] = {
+	{"__func__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY},
+	{NULL}  /* Sentinel */
+};
+
 PyDoc_STRVAR(classmethod_doc,
 "classmethod(function) -> method\n\
 \n\
@@ -825,7 +830,7 @@
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
 	0,					/* tp_methods */
-	0,					/* tp_members */
+	cm_memberlist,		/* tp_members */
 	0,					/* tp_getset */
 	0,					/* tp_base */
 	0,					/* tp_dict */
@@ -925,6 +930,11 @@
 	return 0;
 }
 
+static PyMemberDef sm_memberlist[] = {
+	{"__func__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY},
+	{NULL}  /* Sentinel */
+};
+
 PyDoc_STRVAR(staticmethod_doc,
 "staticmethod(function) -> method\n\
 \n\
@@ -972,7 +982,7 @@
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
 	0,					/* tp_methods */
-	0,					/* tp_members */
+	sm_memberlist,		/* tp_members */
 	0,					/* tp_getset */
 	0,					/* tp_base */
 	0,					/* tp_dict */