[Python-checkins] r61492 - in python/trunk: Misc/NEWS Objects/classobject.c

neal.norwitz python-checkins at python.org
Tue Mar 18 05:46:01 CET 2008


Author: neal.norwitz
Date: Tue Mar 18 05:46:00 2008
New Revision: 61492

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Objects/classobject.c
Log:
Issue 2332: add new attribute names for instance method objects

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Tue Mar 18 05:46:00 2008
@@ -12,6 +12,9 @@
 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.
 

Modified: python/trunk/Objects/classobject.c
==============================================================================
--- python/trunk/Objects/classobject.c	(original)
+++ python/trunk/Objects/classobject.c	Tue Mar 18 05:46:00 2008
@@ -2242,8 +2242,12 @@
 	 "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 */
 };
 


More information about the Python-checkins mailing list