]> granicus.if.org Git - python/commitdiff
Issue 2332: add new attribute names for instance method objects
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 18 Mar 2008 04:46:00 +0000 (04:46 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 18 Mar 2008 04:46:00 +0000 (04:46 +0000)
Misc/NEWS
Objects/classobject.c

index 2975c1530b1a34c6a0c0fcd5442597b81f0d8b83..5382c84a789495dc132d7d574c10a90c649e2046 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 2?
 Core and builtins
 -----------------
 
+- Issue 2332: add new attribute names for instance method objects.
+  The two changes are:  im_self -> __self__ and im_func -> __func__
+
 - Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ on
   exception instances.
 
index 6c77153959b252836ac84db647a770c0b10b9be3..caf6b3e7b0de0a5e82a0f255a5a27d4dfca2e658 100644 (file)
@@ -2242,8 +2242,12 @@ static PyMemberDef instancemethod_memberlist[] = {
         "the class associated with a method"},
        {"im_func",     T_OBJECT,       OFF(im_func),   READONLY|RESTRICTED,
         "the function (or other callable) implementing a method"},
+       {"__func__",    T_OBJECT,       OFF(im_func),   READONLY|RESTRICTED,
+        "the function (or other callable) implementing a method"},
        {"im_self",     T_OBJECT,       OFF(im_self),   READONLY|RESTRICTED,
         "the instance to which a method is bound; None for unbound methods"},
+       {"__self__",    T_OBJECT,       OFF(im_self),   READONLY|RESTRICTED,
+        "the instance to which a method is bound; None for unbound methods"},
        {NULL}  /* Sentinel */
 };