Class around PixMap objects that allows more python-like access. By Joe Strout.
[python/dscho.git] / Tools / modulator / Templates / object_tp_as_mapping
blob440904f56adf31aeddf216a4cccf52a924d52c60
2 /* Code to access $name$ objects as mappings */
4 static int
5 $abbrev$_length(self)
6         $abbrev$object *self;
8         /* XXXX Return the size of the mapping */
11 static PyObject *
12 $abbrev$_subscript(self, key)
13         $abbrev$object *self;
14         PyObject *key;
16         /* XXXX Return the item of self indexed by key */
19 static int
20 $abbrev$_ass_sub(self, v, w)
21         $abbrev$object *self;
22         PyObject *v, *w;
24         /* XXXX Put w in self under key v */
25         return 0;
28 static PyMappingMethods $abbrev$_as_mapping = {
29         (inquiry)$abbrev$_length,               /*mp_length*/
30         (binaryfunc)$abbrev$_subscript,         /*mp_subscript*/
31         (objobjargproc)$abbrev$_ass_sub,        /*mp_ass_subscript*/
34 /* -------------------------------------------------------- */