Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a66c120d
Commit
a66c120d
authored
Sep 06, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document the PyMethod_* type object, functions, and macros.
parent
ef02b5f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
Doc/api/api.tex
Doc/api/api.tex
+58
-0
No files found.
Doc/api/api.tex
View file @
a66c120d
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment