Updated for 2.1a3
[python/dscho.git] / Tools / modulator / Templates / object_tp_as_sequence
blobbc0f470262d9b2e1d7cc7797b25c8e4d2af00a5b
2 /* Code to handle accessing $name$ objects as sequence objects */
4 static int
5 $abbrev$_length(self)
6         $abbrev$object *self;
8         /* XXXX Return the size of the object */
11 static PyObject *
12 $abbrev$_concat(self, bb)
13         $abbrev$object *self;
14         PyObject *bb;
16         /* XXXX Return the concatenation of self and bb */
19 static PyObject *
20 $abbrev$_repeat(self, n)
21         $abbrev$object *self;
22         int n;
24         /* XXXX Return a new object that is n times self */
27 static PyObject *
28 $abbrev$_item(self, i)
29         $abbrev$object *self;
30         int i;
32         /* XXXX Return the i-th object of self */
35 static PyObject *
36 $abbrev$_slice(self, ilow, ihigh)
37         $abbrev$object *self;
38         int ilow, ihigh;
40         /* XXXX Return the ilow..ihigh slice of self in a new object */
43 static int
44 $abbrev$_ass_item(self, i, v)
45         $abbrev$object *self;
46         int i;
47         PyObject *v;
49         /* XXXX Assign to the i-th element of self */
50         return 0;
53 static int
54 $abbrev$_ass_slice(self, ilow, ihigh, v)
55         PyListObject *self;
56         int ilow, ihigh;
57         PyObject *v;
59         /* XXXX Replace ilow..ihigh slice of self with v */
60         return 0;
63 static PySequenceMethods $abbrev$_as_sequence = {
64         (inquiry)$abbrev$_length,               /*sq_length*/
65         (binaryfunc)$abbrev$_concat,            /*sq_concat*/
66         (intargfunc)$abbrev$_repeat,            /*sq_repeat*/
67         (intargfunc)$abbrev$_item,              /*sq_item*/
68         (intintargfunc)$abbrev$_slice,          /*sq_slice*/
69         (intobjargproc)$abbrev$_ass_item,       /*sq_ass_item*/
70         (intintobjargproc)$abbrev$_ass_slice,   /*sq_ass_slice*/
73 /* -------------------------------------------------------------- */