/
usr
/
share
/
doc
/
python2-docs
/
html
/
_sources
/
c-api
/
/usr/share/doc/python2-docs/html/_sources/c-api
mkdir
upload
Name
Size
Mode
Actions
abstract.rst.txt
702
0644
edit
dl
rm
allocation.rst.txt
4796
0644
edit
dl
rm
arg.rst.txt
26004
0644
edit
dl
rm
bool.rst.txt
1304
0644
edit
dl
rm
buffer.rst.txt
22965
0644
edit
dl
rm
bytearray.rst.txt
2181
0644
edit
dl
rm
capsule.rst.txt
5741
0644
edit
dl
rm
cell.rst.txt
1940
0644
edit
dl
rm
class.rst.txt
1866
0644
edit
dl
rm
cobject.rst.txt
1870
0644
edit
dl
rm
code.rst.txt
1635
0644
edit
dl
rm
codec.rst.txt
4643
0644
edit
dl
rm
complex.rst.txt
4079
0644
edit
dl
rm
concrete.rst.txt
1963
0644
edit
dl
rm
conversion.rst.txt
7092
0644
edit
dl
rm
datetime.rst.txt
6413
0644
edit
dl
rm
descriptor.rst.txt
1296
0644
edit
dl
rm
dict.rst.txt
7757
0644
edit
dl
rm
exceptions.rst.txt
35304
0644
edit
dl
rm
file.rst.txt
6198
0644
edit
dl
rm
float.rst.txt
3371
0644
edit
dl
rm
function.rst.txt
2421
0644
edit
dl
rm
gcsupport.rst.txt
6587
0644
edit
dl
rm
gen.rst.txt
920
0644
edit
dl
rm
import.rst.txt
11221
0644
edit
dl
rm
index.rst.txt
578
0644
edit
dl
rm
init.rst.txt
49160
0644
edit
dl
rm
int.rst.txt
4578
0644
edit
dl
rm
intro.rst.txt
28473
0644
edit
dl
rm
iter.rst.txt
1390
0644
edit
dl
rm
iterator.rst.txt
1796
0644
edit
dl
rm
list.rst.txt
6362
0644
edit
dl
rm
long.rst.txt
7987
0644
edit
dl
rm
mapping.rst.txt
2874
0644
edit
dl
rm
marshal.rst.txt
3985
0644
edit
dl
rm
memory.rst.txt
11556
0644
edit
dl
rm
method.rst.txt
2099
0644
edit
dl
rm
module.rst.txt
3867
0644
edit
dl
rm
none.rst.txt
697
0644
edit
dl
rm
number.rst.txt
11939
0644
edit
dl
rm
objbuffer.rst.txt
2516
0644
edit
dl
rm
object.rst.txt
17491
0644
edit
dl
rm
objimpl.rst.txt
305
0644
edit
dl
rm
refcounting.rst.txt
2934
0644
edit
dl
rm
reflection.rst.txt
1567
0644
edit
dl
rm
sequence.rst.txt
8716
0644
edit
dl
rm
set.rst.txt
6588
0644
edit
dl
rm
slice.rst.txt
2979
0644
edit
dl
rm
string.rst.txt
15422
0644
edit
dl
rm
structures.rst.txt
14966
0644
edit
dl
rm
sys.rst.txt
5714
0644
edit
dl
rm
tuple.rst.txt
5491
0644
edit
dl
rm
type.rst.txt
2761
0644
edit
dl
rm
typeobj.rst.txt
66936
0644
edit
dl
rm
unicode.rst.txt
45126
0644
edit
dl
rm
utilities.rst.txt
415
0644
edit
dl
rm
veryhigh.rst.txt
13363
0644
edit
dl
rm
weakref.rst.txt
2820
0644
edit
dl
rm
Edit:
/usr/share/doc/python2-docs/html/_sources/c-api/method.rst.txt
(2099B)
.. highlightlang:: c .. _method-objects: Method Objects -------------- .. index:: object: method There are some useful functions that are useful for working with method objects. .. c:var:: PyTypeObject PyMethod_Type .. index:: single: MethodType (in module types) This instance of :c:type:`PyTypeObject` represents the Python method type. This is exposed to Python programs as ``types.MethodType``. .. c:function:: int PyMethod_Check(PyObject *o) Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). The parameter must not be *NULL*. .. c:function:: PyObject* PyMethod_New(PyObject *func, PyObject *self, PyObject *class) 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.. .. c:function:: 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. .. c:function:: PyObject* PyMethod_GET_CLASS(PyObject *meth) Macro version of :c:func:`PyMethod_Class` which avoids error checking. .. c:function:: PyObject* PyMethod_Function(PyObject *meth) Return the function object associated with the method *meth*. .. c:function:: PyObject* PyMethod_GET_FUNCTION(PyObject *meth) Macro version of :c:func:`PyMethod_Function` which avoids error checking. .. c:function:: PyObject* PyMethod_Self(PyObject *meth) Return the instance associated with the method *meth* if it is bound, otherwise return *NULL*. .. c:function:: PyObject* PyMethod_GET_SELF(PyObject *meth) Macro version of :c:func:`PyMethod_Self` which avoids error checking. .. c:function:: int PyMethod_ClearFreeList() Clear the free list. Return the total number of freed items. .. versionadded:: 2.6
Save
cmd:
run