cpython/Tools/modulator/Templates/object_tp_as_sequence

74 lines
1.5 KiB
Plaintext
Raw Normal View History

1995-03-02 10:05:29 -04:00
/* Code to handle accessing $name$ objects as sequence objects */
static int
$abbrev$_length(self)
$abbrev$object *self;
{
/* XXXX Return the size of the object */
}
static PyObject *
1995-03-02 10:05:29 -04:00
$abbrev$_concat(self, bb)
$abbrev$object *self;
PyObject *bb;
1995-03-02 10:05:29 -04:00
{
/* XXXX Return the concatenation of self and bb */
}
static PyObject *
1995-03-02 10:05:29 -04:00
$abbrev$_repeat(self, n)
$abbrev$object *self;
int n;
{
/* XXXX Return a new object that is n times self */
}
static PyObject *
1995-03-02 10:05:29 -04:00
$abbrev$_item(self, i)
$abbrev$object *self;
int i;
{
/* XXXX Return the i-th object of self */
}
static PyObject *
1995-03-02 10:05:29 -04:00
$abbrev$_slice(self, ilow, ihigh)
$abbrev$object *self;
int ilow, ihigh;
{
/* XXXX Return the ilow..ihigh slice of self in a new object */
}
static int
$abbrev$_ass_item(self, i, v)
$abbrev$object *self;
int i;
PyObject *v;
1995-03-02 10:05:29 -04:00
{
/* XXXX Assign to the i-th element of self */
return 0;
}
static int
$abbrev$_ass_slice(self, ilow, ihigh, v)
PyListObject *self;
1995-03-02 10:05:29 -04:00
int ilow, ihigh;
PyObject *v;
1995-03-02 10:05:29 -04:00
{
/* XXXX Replace ilow..ihigh slice of self with v */
return 0;
}
static PySequenceMethods $abbrev$_as_sequence = {
1995-03-02 10:05:29 -04:00
(inquiry)$abbrev$_length, /*sq_length*/
(binaryfunc)$abbrev$_concat, /*sq_concat*/
(intargfunc)$abbrev$_repeat, /*sq_repeat*/
(intargfunc)$abbrev$_item, /*sq_item*/
(intintargfunc)$abbrev$_slice, /*sq_slice*/
(intobjargproc)$abbrev$_ass_item, /*sq_ass_item*/
(intintobjargproc)$abbrev$_ass_slice, /*sq_ass_slice*/
};
/* -------------------------------------------------------------- */