summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-09-06 17:12:44 (GMT)
committerFred Drake <fdrake@acm.org>2001-09-06 17:12:44 (GMT)
commitf8d7a5d391350a3208276c36e06b52ad44a15382 (patch)
treec4ede99574a3e5c062838c1841f838d726d69909 /Doc/api
parent0511b764d1eba1e4f24b273ee3527c8ffcefb714 (diff)
downloadcpython-f8d7a5d391350a3208276c36e06b52ad44a15382.zip
cpython-f8d7a5d391350a3208276c36e06b52ad44a15382.tar.gz
cpython-f8d7a5d391350a3208276c36e06b52ad44a15382.tar.bz2
Document the PyMethod_* type object, functions, and macros.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/api.tex58
1 files changed, 58 insertions, 0 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex
index 2527bd6..24e2156 100644
--- a/Doc/api/api.tex
+++ b/Doc/api/api.tex
@@ -4089,6 +4089,64 @@ There are very few functions specific to instance objects.
\end{cfuncdesc}
+\subsection{Method Objects \label{method-objects}}
+
+\obindex{method}
+There are some useful functions that are useful for working with
+method objects.
+
+\begin{cvardesc}{PyTypeObject}{PyMethod_Type}
+ This instance of \ctype{PyTypeObject} represents the Python method
+ type. This is exposed to Python programs as \code{types.MethodType}.
+ \withsubitem{(in module types)}{\ttindex{MethodType}}
+\end{cvardesc}
+
+\begin{cfuncdesc}{int}{PyMethod_Check}{PyObject *o}
+ Return true if \var{o} is a method object (has type
+ \cdata{PyMethod_Type}). The parameter must not be \NULL.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_New}{PyObject *func.
+ PyObject *self, PyObject *class}
+ Return a new method object, with \var{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, \var{self}
+ should be the instance and \var{class} should be the class of
+ \var{self}, otherwise \var{self} should be \NULL{} and \var{class}
+ should be the class which provides the unbound method..
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_Class}{PyObject *meth}
+ Return the class object from which the method \var{meth} was
+ created; if this was created from an instance, it will be the class
+ of the instance.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_GET_CLASS}{PyObject *meth}
+ Macro version of \cfunction{PyMethod_Class()} which avoids error
+ checking.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_Function}{PyObject *meth}
+ Return the function object associated with the method \var{meth}.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_GET_FUNCTION}{PyObject *meth}
+ Macro version of \cfunction{PyMethod_Function()} which avoids error
+ checking.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_Self}{PyObject *meth}
+ Return the instance associated with the method \var{meth} if it is
+ bound, otherwise return \NULL.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyMethod_GET_SELF}{PyObject *meth}
+ Macro version of \cfunction{PyMethod_Self()} which avoids error
+ checking.
+\end{cfuncdesc}
+
+
\subsection{Module Objects \label{moduleObjects}}
\obindex{module}