diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-27 10:40:20 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-27 10:40:20 (GMT) |
commit | ff737954f3ee3005236133fc51b55a508b11aa06 (patch) | |
tree | b65ae9e39e774bd73674b5088e549d09a7bfd7d6 /Objects/funcobject.c | |
parent | 0d3fb8a944a810f421377d5823cbc006700b3c1d (diff) | |
download | cpython-ff737954f3ee3005236133fc51b55a508b11aa06.zip cpython-ff737954f3ee3005236133fc51b55a508b11aa06.tar.gz cpython-ff737954f3ee3005236133fc51b55a508b11aa06.tar.bz2 |
Removed the API to create unbound methods and simplified the API for bound methods. The signature is PyMethod_New(func, instance).
Also removed im_class and renamed im_self to __self__ and im_func to __func__. im_class can be substituted with method.__self__.__class__.
I've also updated some parts of the documenation.
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r-- | Objects/funcobject.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index f9b0346..ac68edc 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -647,7 +647,7 @@ func_descr_get(PyObject *func, PyObject *obj, PyObject *type) Py_INCREF(func); return func; } - return PyMethod_New(func, obj, type); + return PyMethod_New(func, obj); } PyTypeObject PyFunction_Type = { @@ -751,8 +751,7 @@ cm_descr_get(PyObject *self, PyObject *obj, PyObject *type) } if (type == NULL) type = (PyObject *)(Py_Type(obj)); - return PyMethod_New(cm->cm_callable, - type, (PyObject *)(Py_Type(type))); + return PyMethod_New(cm->cm_callable, type); } static int |