88
/* StaticTupleInterner_Add returns whatever object is present at self
88
/* SimpleSet_Add returns whatever object is present at self
89
89
* or the new object if it needs to add it.
91
unique_key = StaticTupleInterner_Add(_interned_tuples, (PyObject *)self);
91
unique_key = SimpleSet_Add(_interned_tuples, (PyObject *)self);
93
93
// Suppress any error and just return the object
592
592
(traverseproc)StaticTuple_traverse, /* tp_traverse */
593
593
0, /* tp_clear */
594
// TODO: implement richcompare, we should probably be able to compare vs an
595
// tuple, as well as versus another StaticTuples object.
596
594
StaticTuple_richcompare, /* tp_richcompare */
597
595
0, /* tp_weaklistoffset */
598
// We could implement this as returning tuples of keys...
596
// without implementing tp_iter, Python will fall back to PySequence*
597
// which seems to work ok, we may need something faster/lighter in the
600
600
0, /* tp_iternext */
601
601
StaticTuple_methods, /* tp_methods */
615
static char KeyIntern_doc[] = "";
617
static PyMethodDef KeyIntern_methods[] = {
618
// {"as_tuple", (PyCFunction)Keys_as_tuple, METH_NOARGS, Keys_as_tuple_doc},
619
{NULL, NULL} /* sentinel */
622
// static PySequenceMethods KeyIntern_as_sequence = {
623
// 0, //(lenfunc)Keys_length, /* sq_length */
624
// 0, /* sq_concat */
625
// 0, /* sq_repeat */
626
// 0, //(ssizeargfunc)Keys_item, /* sq_item */
628
// 0, /* sq_ass_item */
629
// 0, /* sq_ass_slice */
630
// 0, /* sq_contains */
633
// static PyTypeObject KeyIntern_Type = {
634
// PyObject_HEAD_INIT(NULL)
636
// "KeyIntern", /* tp_name */
637
// sizeof(KeyIntern) - sizeof(Key *), /* tp_basicsize */
638
// sizeof(Key *), /* tp_itemsize */
639
// 0, //(destructor)Keys_dealloc, /* tp_dealloc */
641
// 0, /* tp_getattr */
642
// 0, /* tp_setattr */
643
// 0, /* tp_compare */
644
// // TODO: implement repr() and possibly str()
645
// 0, //(reprfunc)Keys_repr, /* tp_repr */
646
// 0, /* tp_as_number */
647
// &KeyIntern_as_sequence, /* tp_as_sequence */
648
// 0, /* tp_as_mapping */
649
// 0, //(hashfunc)Keys_hash, /* tp_hash */
652
// PyObject_GenericGetAttr, /* tp_getattro */
653
// 0, /* tp_setattro */
654
// 0, /* tp_as_buffer */
655
// Py_TPFLAGS_DEFAULT, /* tp_flags*/
656
// 0, // Keys_doc, /* tp_doc */
657
// /* See Key_traverse for why we have this, even though we aren't GC */
658
// 0, //(traverseproc)Keys_traverse, /* tp_traverse */
660
// // TODO: implement richcompare, we should probably be able to compare vs an
661
// // tuple, as well as versus another Keys object.
662
// 0, //Keys_richcompare, /* tp_richcompare */
663
// 0, /* tp_weaklistoffset */
664
// // We could implement this as returning tuples of keys...
666
// 0, /* tp_iternext */
667
// KeyIntern_methods, /* tp_methods */
668
// 0, /* tp_members */
669
// 0, /* tp_getset */
672
// 0, /* tp_descr_get */
673
// 0, /* tp_descr_set */
674
// 0, /* tp_dictoffset */
677
// 0, //Keys_new, /* tp_new */
681
615
static PyMethodDef static_tuple_c_methods[] = {
682
// {"unique_lcs_c", py_unique_lcs, METH_VARARGS},
683
// {"recurse_matches_c", py_recurse_matches, METH_VARARGS},