]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cleanups and documentation updates related to the removal of unbound methods.
authorChristian Heimes <christian@cheimes.de>
Fri, 30 Nov 2007 22:29:24 +0000 (22:29 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 30 Nov 2007 22:29:24 +0000 (22:29 +0000)
Doc/c-api/concrete.rst
Doc/library/types.rst
Include/classobject.h

index 50ab005ddf2eed42792d43785cba097a3949827f..b6cc60e9ac20ae830059c918d74caef031245b9c 100644 (file)
@@ -2577,7 +2577,9 @@ Method Objects
 
 .. index:: object: method
 
-There are some useful functions that are useful for working with method objects.
+Methods are bound function objects. Methods are always bound to an instance of
+an user-defined class. Unbound methods (methods bound to a class object) are
+no longer available.
 
 
 .. cvar:: PyTypeObject PyMethod_Type
@@ -2594,25 +2596,11 @@ There are some useful functions that are useful for working with method objects.
    parameter must not be *NULL*.
 
 
-.. cfunction:: PyObject* PyMethod_New(PyObject *func, PyObject *self, PyObject *class)
+.. cfunction:: PyObject* PyMethod_New(PyObject *func, PyObject *self)
 
-   Return a new method object, with *func* being any callable object; this is the
-   function that will be called when the method is called.  If this method should
-   be bound to an instance, *self* should be the instance and *class* should be the
-   class of *self*, otherwise *self* should be *NULL* and *class* should be the
-   class which provides the unbound method.
-
-   .. XXX no unbound methods anymore...
-
-.. cfunction:: PyObject* PyMethod_Class(PyObject *meth)
-
-   Return the class object from which the method *meth* was created; if this was
-   created from an instance, it will be the class of the instance.
-
-
-.. cfunction:: PyObject* PyMethod_GET_CLASS(PyObject *meth)
-
-   Macro version of :cfunc:`PyMethod_Class` which avoids error checking.
+   Return a new method object, with *func* being any callable object and *self*
+   the instance the method should be bound. *func* is is the function that will
+   be called when the method is called. *self* must not be *NULL*.
 
 
 .. cfunction:: PyObject* PyMethod_Function(PyObject *meth)
@@ -2627,8 +2615,7 @@ There are some useful functions that are useful for working with method objects.
 
 .. cfunction:: PyObject* PyMethod_Self(PyObject *meth)
 
-   Return the instance associated with the method *meth* if it is bound, otherwise
-   return *NULL*.
+   Return the instance associated with the method *meth*.
 
 
 .. cfunction:: PyObject* PyMethod_GET_SELF(PyObject *meth)
index a3d30fa97995d74567b3e23b85416d97edc2c362..ddb7e7dcc1f9bfc3c05fe5783cf81838e3058a87 100644 (file)
@@ -58,7 +58,6 @@ The module defines the following names:
 
 
 .. data:: MethodType
-          UnboundMethdType
 
    The type of methods of user-defined class instances.
 
index e6ca421a5be32391e8d3f63e08ad6f7f557111f3..699546e3020b05ab0ac5090f1f8c03ee9fd601ba 100644 (file)
@@ -23,7 +23,6 @@ PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
 
 PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
 PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
-PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *);
 
 /* Macros for direct access to these values. Type checks are *not*
    done, so use with care. */