Commit b1d3d963 authored by Neal Norwitz's avatar Neal Norwitz

Issue 2332: add new attribute names for instance method objects

parent 3781aef8
...@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 2? ...@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 2?
Core and builtins 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 - Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ on
exception instances. exception instances.
......
...@@ -2242,8 +2242,12 @@ static PyMemberDef instancemethod_memberlist[] = { ...@@ -2242,8 +2242,12 @@ static PyMemberDef instancemethod_memberlist[] = {
"the class associated with a method"}, "the class associated with a method"},
{"im_func", T_OBJECT, OFF(im_func), READONLY|RESTRICTED, {"im_func", T_OBJECT, OFF(im_func), READONLY|RESTRICTED,
"the function (or other callable) implementing a method"}, "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, {"im_self", T_OBJECT, OFF(im_self), READONLY|RESTRICTED,
"the instance to which a method is bound; None for unbound methods"}, "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 */ {NULL} /* Sentinel */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment