[Zope-Checkins] CVS: Zope2 - TreeSetTemplate.c:1.8

Jim Fulton jim@digicool.com
Fri, 16 Mar 2001 19:47:30 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/BTrees
In directory korak:/tmp/cvs-serv27537

Modified Files:
	TreeSetTemplate.c 
Log Message:
Broke down and added length operation to tree sets. This is needed for 
in Catalog when a sort-index is used. Waaaa.



--- Updated File TreeSetTemplate.c in package Zope2 --
--- TreeSetTemplate.c	2001/03/15 17:33:07	1.7
+++ TreeSetTemplate.c	2001/03/17 00:47:30	1.8
@@ -191,6 +191,10 @@
   {NULL,		NULL}		/* sentinel */
 };
 
+static PyMappingMethods TreeSet_as_mapping = {
+  (inquiry)BTree_length,		/*mp_length*/
+};
+
 static PyExtensionClass TreeSetType = {
   PyObject_HEAD_INIT(NULL)
   0,				/*ob_size*/
@@ -206,7 +210,7 @@
   (reprfunc)0,			/*tp_repr*/
   &BTree_as_number_for_nonzero,	/*tp_as_number*/
   0,				/*tp_as_sequence*/
-  0,				/*tp_as_mapping*/
+  &TreeSet_as_mapping,		/*tp_as_mapping*/
   (hashfunc)0,			/*tp_hash*/
   (ternaryfunc)0,		/*tp_call*/
   (reprfunc)0,			/*tp_str*/