cpython/Tools/modulator/Templates/object_tp_as_mapping

30 lines
670 B
Plaintext
Raw Normal View History

1995-03-02 14:05:29 +00:00
/* Code to access $name$ objects as mappings */
static int
$abbrev$_length($abbrev$object *self)
1995-03-02 14:05:29 +00:00
{
/* XXXX Return the size of the mapping */
}
static PyObject *
$abbrev$_subscript($abbrev$object *self, PyObject *key)
1995-03-02 14:05:29 +00:00
{
/* XXXX Return the item of self indexed by key */
}
static int
$abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
1995-03-02 14:05:29 +00:00
{
/* XXXX Put w in self under key v */
return 0;
}
static PyMappingMethods $abbrev$_as_mapping = {
1995-03-02 14:05:29 +00:00
(inquiry)$abbrev$_length, /*mp_length*/
(binaryfunc)$abbrev$_subscript, /*mp_subscript*/
(objobjargproc)$abbrev$_ass_sub, /*mp_ass_subscript*/
};
/* -------------------------------------------------------- */