~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Tools/modulator/Templates/object_tp_as_mapping

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* Code to access $name$ objects as mappings */
 
3
 
 
4
static int
 
5
$abbrev$_length($abbrev$object *self)
 
6
{
 
7
        /* XXXX Return the size of the mapping */
 
8
}
 
9
 
 
10
static PyObject *
 
11
$abbrev$_subscript($abbrev$object *self, PyObject *key)
 
12
{
 
13
        /* XXXX Return the item of self indexed by key */
 
14
}
 
15
 
 
16
static int
 
17
$abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
 
18
{
 
19
        /* XXXX Put w in self under key v */
 
20
        return 0;
 
21
}
 
22
 
 
23
static PyMappingMethods $abbrev$_as_mapping = {
 
24
        (inquiry)$abbrev$_length,               /*mp_length*/
 
25
        (binaryfunc)$abbrev$_subscript,         /*mp_subscript*/
 
26
        (objobjargproc)$abbrev$_ass_sub,        /*mp_ass_subscript*/
 
27
};
 
28
 
 
29
/* -------------------------------------------------------- */