Commit ab1ec3ee authored by Jim Fulton's avatar Jim Fulton

Broke down and added length operation to tree sets. This is needed for

in Catalog when a sort-index is used. Waaaa.
parent 2312b607
...@@ -191,6 +191,10 @@ static struct PyMethodDef TreeSet_methods[] = { ...@@ -191,6 +191,10 @@ static struct PyMethodDef TreeSet_methods[] = {
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
static PyMappingMethods TreeSet_as_mapping = {
(inquiry)BTree_length, /*mp_length*/
};
static PyExtensionClass TreeSetType = { static PyExtensionClass TreeSetType = {
PyObject_HEAD_INIT(NULL) PyObject_HEAD_INIT(NULL)
0, /*ob_size*/ 0, /*ob_size*/
...@@ -206,7 +210,7 @@ static PyExtensionClass TreeSetType = { ...@@ -206,7 +210,7 @@ static PyExtensionClass TreeSetType = {
(reprfunc)0, /*tp_repr*/ (reprfunc)0, /*tp_repr*/
&BTree_as_number_for_nonzero, /*tp_as_number*/ &BTree_as_number_for_nonzero, /*tp_as_number*/
0, /*tp_as_sequence*/ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/ &TreeSet_as_mapping, /*tp_as_mapping*/
(hashfunc)0, /*tp_hash*/ (hashfunc)0, /*tp_hash*/
(ternaryfunc)0, /*tp_call*/ (ternaryfunc)0, /*tp_call*/
(reprfunc)0, /*tp_str*/ (reprfunc)0, /*tp_str*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment