Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 8b1ab69fea05dfd07ddd2d6af9c9b0c26c61b5dd authored by cvs2svn on 02 October 2003, 12:50:18 UTC
This commit was manufactured by cvs2svn to create tag 'r232'.
Tip revision: 8b1ab69
object_tp_as_mapping

/* Code to access $name$ objects as mappings */

static int
$abbrev$_length($abbrev$object *self)
{
	/* XXXX Return the size of the mapping */
}

static PyObject *
$abbrev$_subscript($abbrev$object *self, PyObject *key)
{
	/* XXXX Return the item of self indexed by key */
}

static int
$abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
{
	/* XXXX Put w in self under key v */
	return 0;
}

static PyMappingMethods $abbrev$_as_mapping = {
	(inquiry)$abbrev$_length,		/*mp_length*/
	(binaryfunc)$abbrev$_subscript,		/*mp_subscript*/
	(objobjargproc)$abbrev$_ass_sub,	/*mp_ass_subscript*/
};

/* -------------------------------------------------------- */
back to top