1
/* Copyright (C) 2009 Canonical Ltd
3
* This program is free software; you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation; either version 2 of the License, or
6
* (at your option) any later version.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
/* Must be defined before importing _static_tuple_c.h so that we get the right
21
#define STATIC_TUPLE_MODULE
24
#include "python-compat.h"
26
#include "_static_tuple_c.h"
27
#include "_export_c_api.h"
29
/* Pyrex 0.9.6.4 exports _simple_set_pyx_api as
30
* import__simple_set_pyx(), while Pyrex 0.9.8.5 and Cython 0.11.3 export them
31
* as import_bzrlib___simple_set_pyx(). As such, we just #define one to be
32
* equivalent to the other in our internal code.
34
#define import__simple_set_pyx import_bzrlib___simple_set_pyx
35
#include "_simple_set_pyx_api.h"
38
# define inline __inline__
39
#elif defined(_MSC_VER)
40
# define inline __inline
46
/* The one and only StaticTuple with no values */
47
static StaticTuple *_empty_tuple = NULL;
48
static PyObject *_interned_tuples = NULL;
52
_StaticTuple_is_interned(StaticTuple *self)
54
return self->flags & STATIC_TUPLE_INTERNED_FLAG;
60
StaticTuple_as_tuple(StaticTuple *self)
62
PyObject *tpl = NULL, *obj = NULL;
66
tpl = PyTuple_New(len);
71
for (i = 0; i < len; ++i) {
72
obj = (PyObject *)self->items[i];
74
PyTuple_SET_ITEM(tpl, i, obj);
80
static char StaticTuple_as_tuple_doc[] = "as_tuple() => tuple";
83
StaticTuple_Intern(StaticTuple *self)
85
PyObject *canonical_tuple = NULL;
87
if (_interned_tuples == NULL || _StaticTuple_is_interned(self)) {
91
/* SimpleSet_Add returns whatever object is present at self
92
* or the new object if it needs to add it.
94
canonical_tuple = SimpleSet_Add(_interned_tuples, (PyObject *)self);
95
if (!canonical_tuple) {
96
// Some sort of exception, propogate it.
99
if (canonical_tuple != (PyObject *)self) {
100
// There was already a tuple with that value
101
return (StaticTuple *)canonical_tuple;
103
self->flags |= STATIC_TUPLE_INTERNED_FLAG;
104
// The two references in the dict do not count, so that the StaticTuple
105
// object does not become immortal just because it was interned.
106
Py_REFCNT(self) -= 1;
110
static char StaticTuple_Intern_doc[] = "intern() => unique StaticTuple\n"
111
"Return a 'canonical' StaticTuple object.\n"
112
"Similar to intern() for strings, this makes sure there\n"
113
"is only one StaticTuple object for a given value\n."
115
" key = StaticTuple('foo', 'bar').intern()\n";
119
StaticTuple_dealloc(StaticTuple *self)
123
if (_StaticTuple_is_interned(self)) {
124
/* revive dead object temporarily for Discard */
126
if (SimpleSet_Discard(_interned_tuples, (PyObject*)self) != 1)
127
Py_FatalError("deletion of interned StaticTuple failed");
128
self->flags &= ~STATIC_TUPLE_INTERNED_FLAG;
131
for (i = 0; i < len; ++i) {
132
Py_XDECREF(self->items[i]);
134
Py_TYPE(self)->tp_free((PyObject *)self);
138
/* Similar to PyTuple_New() */
140
StaticTuple_New(Py_ssize_t size)
144
PyErr_BadInternalCall();
148
if (size < 0 || size > 255) {
149
/* Too big or too small */
150
PyErr_SetString(PyExc_ValueError, "StaticTuple(...)"
151
" takes from 0 to 255 items");
154
if (size == 0 && _empty_tuple != NULL) {
155
Py_INCREF(_empty_tuple);
158
/* Note that we use PyObject_NewVar because we want to allocate a variable
159
* width entry. However we *aren't* truly a PyVarObject because we don't
160
* use a long for ob_size. Instead we use a plain 'size' that is an int,
161
* and will be overloaded with flags in the future.
162
* As such we do the alloc, and then have to clean up anything it does
165
stuple = PyObject_NewVar(StaticTuple, &StaticTuple_Type, size);
166
if (stuple == NULL) {
171
stuple->_unused0 = 0;
172
stuple->_unused1 = 0;
174
memset(stuple->items, 0, sizeof(PyObject *) * size);
176
#if STATIC_TUPLE_HAS_HASH
184
StaticTuple_FromSequence(PyObject *sequence)
190
if (StaticTuple_CheckExact(sequence)) {
192
return (StaticTuple *)sequence;
194
if (!PySequence_Check(sequence)) {
195
PyErr_Format(PyExc_TypeError, "Type %s is not a sequence type",
196
Py_TYPE(sequence)->tp_name);
199
size = PySequence_Size(sequence);
202
new = StaticTuple_New(size);
206
for (i = 0; i < size; ++i) {
207
// This returns a new reference, which we then 'steal' with
208
// StaticTuple_SET_ITEM
209
item = PySequence_GetItem(sequence, i);
214
StaticTuple_SET_ITEM(new, i, item);
216
return (StaticTuple *)new;
220
StaticTuple_from_sequence(PyObject *self, PyObject *args, PyObject *kwargs)
223
if (!PyArg_ParseTuple(args, "O", &sequence))
225
return StaticTuple_FromSequence(sequence);
229
/* Check that all items we point to are 'valid' */
231
StaticTuple_check_items(StaticTuple *self)
236
for (i = 0; i < self->size; ++i) {
237
obj = self->items[i];
239
PyErr_SetString(PyExc_RuntimeError, "StaticTuple(...)"
240
" should not have a NULL entry.");
243
if (PyString_CheckExact(obj)
244
|| StaticTuple_CheckExact(obj)
247
|| PyInt_CheckExact(obj)
248
|| PyLong_CheckExact(obj)
249
|| PyFloat_CheckExact(obj)
250
|| PyUnicode_CheckExact(obj)
252
PyErr_Format(PyExc_TypeError, "StaticTuple(...)"
253
" requires that all items are one of"
254
" str, StaticTuple, None, bool, int, long, float, or unicode"
255
" not %s.", Py_TYPE(obj)->tp_name);
262
StaticTuple_new_constructor(PyTypeObject *type, PyObject *args, PyObject *kwds)
265
PyObject *obj = NULL;
266
Py_ssize_t i, len = 0;
268
if (type != &StaticTuple_Type) {
269
PyErr_SetString(PyExc_TypeError, "we only support creating StaticTuple");
272
if (!PyTuple_CheckExact(args)) {
273
PyErr_SetString(PyExc_TypeError, "args must be a tuple");
276
len = PyTuple_GET_SIZE(args);
277
self = (StaticTuple *)StaticTuple_New(len);
281
for (i = 0; i < len; ++i) {
282
obj = PyTuple_GET_ITEM(args, i);
284
self->items[i] = obj;
286
if (!StaticTuple_check_items(self)) {
287
type->tp_dealloc((PyObject *)self);
290
return (PyObject *)self;
294
StaticTuple_repr(StaticTuple *self)
296
PyObject *as_tuple, *tuple_repr, *result;
298
as_tuple = StaticTuple_as_tuple(self);
299
if (as_tuple == NULL) {
302
tuple_repr = PyObject_Repr(as_tuple);
304
if (tuple_repr == NULL) {
307
result = PyString_FromFormat("StaticTuple%s",
308
PyString_AsString(tuple_repr));
313
StaticTuple_hash(StaticTuple *self)
315
/* adapted from tuplehash(), is the specific hash value considered
319
Py_ssize_t len = self->size;
321
long mult = 1000003L;
323
#if STATIC_TUPLE_HAS_HASH
324
if (self->hash != -1) {
330
// TODO: We could set specific flags if we know that, for example, all the
331
// items are strings. I haven't seen a real-world benefit to that
334
y = PyObject_Hash(*p++);
335
if (y == -1) /* failure */
338
/* the cast might truncate len; that doesn't change hash stability */
339
mult += (long)(82520L + len + len);
344
#if STATIC_TUPLE_HAS_HASH
351
StaticTuple_richcompare_to_tuple(StaticTuple *v, PyObject *wt, int op)
354
PyObject *result = NULL;
356
vt = StaticTuple_as_tuple((StaticTuple *)v);
360
if (!PyTuple_Check(wt)) {
361
PyErr_BadInternalCall();
364
/* Now we have 2 tuples to compare, do it */
365
result = PyTuple_Type.tp_richcompare(vt, wt, op);
371
/** Compare two objects to determine if they are equivalent.
372
* The basic flow is as follows
373
* 1) First make sure that both objects are StaticTuple instances. If they
374
* aren't then cast self to a tuple, and have the tuple do the comparison.
375
* 2) Special case comparison to Py_None, because it happens to occur fairly
376
* often in the test suite.
377
* 3) Special case when v and w are the same pointer. As we know the answer to
378
* all queries without walking individual items.
379
* 4) For all operations, we then walk the items to find the first paired
380
* items that are not equal.
381
* 5) If all items found are equal, we then check the length of self and
382
* other to determine equality.
383
* 6) If an item differs, then we apply "op" to those last two items. (eg.
384
* StaticTuple(A, B) > StaticTuple(A, C) iff B > C)
388
StaticTuple_richcompare(PyObject *v, PyObject *w, int op)
390
StaticTuple *v_st, *w_st;
391
Py_ssize_t vlen, wlen, min_len, i;
392
PyObject *v_obj, *w_obj;
393
richcmpfunc string_richcompare;
395
if (!StaticTuple_CheckExact(v)) {
396
/* This has never triggered, according to python-dev it seems this
397
* might trigger if '__op__' is defined but '__rop__' is not, sort of
398
* case. Such as "None == StaticTuple()"
400
fprintf(stderr, "self is not StaticTuple\n");
401
Py_INCREF(Py_NotImplemented);
402
return Py_NotImplemented;
404
v_st = (StaticTuple *)v;
405
if (StaticTuple_CheckExact(w)) {
406
/* The most common case */
407
w_st = (StaticTuple*)w;
408
} else if (PyTuple_Check(w)) {
409
/* One of v or w is a tuple, so we go the 'slow' route and cast up to
412
/* TODO: This seems to be triggering more than I thought it would...
413
* We probably want to optimize comparing self to other when
416
return StaticTuple_richcompare_to_tuple(v_st, w, op);
417
} else if (w == Py_None) {
418
// None is always less than the object
420
case Py_NE:case Py_GT:case Py_GE:
423
case Py_EQ:case Py_LT:case Py_LE:
426
default: // Should never happen
427
return Py_NotImplemented;
430
/* We don't special case this comparison, we just let python handle
433
Py_INCREF(Py_NotImplemented);
434
return Py_NotImplemented;
436
/* Now we know that we have 2 StaticTuple objects, so let's compare them.
437
* This code is inspired from tuplerichcompare, except we know our
438
* objects are limited in scope, so we can inline some comparisons.
441
/* Identical pointers, we can shortcut this easily. */
443
case Py_EQ:case Py_LE:case Py_GE:
446
case Py_NE:case Py_LT:case Py_GT:
452
&& _StaticTuple_is_interned(v_st)
453
&& _StaticTuple_is_interned(w_st))
455
/* If both objects are interned, we know they are different if the
456
* pointer is not the same, which would have been handled by the
457
* previous if. No need to compare the entries.
463
/* The only time we are likely to compare items of different lengths is in
464
* something like the interned_keys set. However, the hash is good enough
465
* that it is rare. Note that 'tuple_richcompare' also does not compare
470
min_len = (vlen < wlen) ? vlen : wlen;
471
string_richcompare = PyString_Type.tp_richcompare;
472
for (i = 0; i < min_len; i++) {
473
PyObject *result = NULL;
474
v_obj = StaticTuple_GET_ITEM(v_st, i);
475
w_obj = StaticTuple_GET_ITEM(w_st, i);
476
if (v_obj == w_obj) {
477
/* Shortcut case, these must be identical */
480
if (PyString_CheckExact(v_obj) && PyString_CheckExact(w_obj)) {
481
result = string_richcompare(v_obj, w_obj, Py_EQ);
482
} else if (StaticTuple_CheckExact(v_obj) &&
483
StaticTuple_CheckExact(w_obj))
485
/* Both are StaticTuple types, so recurse */
486
result = StaticTuple_richcompare(v_obj, w_obj, Py_EQ);
488
/* Fall back to generic richcompare */
489
result = PyObject_RichCompare(v_obj, w_obj, Py_EQ);
491
if (result == NULL) {
492
return NULL; /* There seems to be an error */
494
if (result == Py_False) {
495
// This entry is not identical, Shortcut for Py_EQ
502
if (result != Py_True) {
503
/* We don't know *what* richcompare is returning, but it
504
* isn't something we recognize
506
PyErr_BadInternalCall();
513
/* We walked off one of the lists, but everything compared equal so
514
* far. Just compare the size.
519
case Py_LT: cmp = vlen < wlen; break;
520
case Py_LE: cmp = vlen <= wlen; break;
521
case Py_EQ: cmp = vlen == wlen; break;
522
case Py_NE: cmp = vlen != wlen; break;
523
case Py_GT: cmp = vlen > wlen; break;
524
case Py_GE: cmp = vlen >= wlen; break;
525
default: return NULL; /* cannot happen */
534
/* The last item differs, shortcut the Py_NE case */
539
/* It is some other comparison, go ahead and do the real check. */
540
if (PyString_CheckExact(v_obj) && PyString_CheckExact(w_obj))
542
return string_richcompare(v_obj, w_obj, op);
543
} else if (StaticTuple_CheckExact(v_obj) &&
544
StaticTuple_CheckExact(w_obj))
546
/* Both are StaticTuple types, so recurse */
547
return StaticTuple_richcompare(v_obj, w_obj, op);
549
return PyObject_RichCompare(v_obj, w_obj, op);
555
StaticTuple_length(StaticTuple *self)
562
StaticTuple__is_interned(StaticTuple *self)
564
if (_StaticTuple_is_interned(self)) {
572
static char StaticTuple__is_interned_doc[] = "_is_interned() => True/False\n"
573
"Check to see if this tuple has been interned.\n";
577
StaticTuple_reduce(StaticTuple *self)
579
PyObject *result = NULL, *as_tuple = NULL;
581
result = PyTuple_New(2);
585
as_tuple = StaticTuple_as_tuple(self);
586
if (as_tuple == NULL) {
590
Py_INCREF(&StaticTuple_Type);
591
PyTuple_SET_ITEM(result, 0, (PyObject *)&StaticTuple_Type);
592
PyTuple_SET_ITEM(result, 1, as_tuple);
596
static char StaticTuple_reduce_doc[] = "__reduce__() => tuple\n";
600
StaticTuple_add(PyObject *v, PyObject *w)
602
Py_ssize_t i, len_v, len_w;
605
/* StaticTuples and plain tuples may be added (concatenated) to
608
if (StaticTuple_CheckExact(v)) {
609
len_v = ((StaticTuple*)v)->size;
610
} else if (PyTuple_Check(v)) {
611
len_v = PyTuple_GET_SIZE(v);
613
Py_INCREF(Py_NotImplemented);
614
return Py_NotImplemented;
616
if (StaticTuple_CheckExact(w)) {
617
len_w = ((StaticTuple*)w)->size;
618
} else if (PyTuple_Check(w)) {
619
len_w = PyTuple_GET_SIZE(w);
621
Py_INCREF(Py_NotImplemented);
622
return Py_NotImplemented;
624
result = StaticTuple_New(len_v + len_w);
627
for (i = 0; i < len_v; ++i) {
628
// This returns a new reference, which we then 'steal' with
629
// StaticTuple_SET_ITEM
630
item = PySequence_GetItem(v, i);
635
StaticTuple_SET_ITEM(result, i, item);
637
for (i = 0; i < len_w; ++i) {
638
item = PySequence_GetItem(w, i);
643
StaticTuple_SET_ITEM(result, i+len_v, item);
645
if (!StaticTuple_check_items(result)) {
649
return (PyObject *)result;
653
StaticTuple_item(StaticTuple *self, Py_ssize_t offset)
656
/* We cast to (int) to avoid worrying about whether Py_ssize_t is a
657
* long long, etc. offsets should never be >2**31 anyway.
660
PyErr_Format(PyExc_IndexError, "StaticTuple_item does not support"
661
" negative indices: %d\n", (int)offset);
662
} else if (offset >= self->size) {
663
PyErr_Format(PyExc_IndexError, "StaticTuple index out of range"
664
" %d >= %d", (int)offset, (int)self->size);
667
obj = (PyObject *)self->items[offset];
673
StaticTuple_slice(StaticTuple *self, Py_ssize_t ilow, Py_ssize_t ihigh)
675
PyObject *as_tuple, *result;
677
as_tuple = StaticTuple_as_tuple(self);
678
if (as_tuple == NULL) {
681
result = PyTuple_Type.tp_as_sequence->sq_slice(as_tuple, ilow, ihigh);
687
StaticTuple_traverse(StaticTuple *self, visitproc visit, void *arg)
690
for (i = self->size; --i >= 0;) {
691
Py_VISIT(self->items[i]);
696
static char StaticTuple_doc[] =
697
"C implementation of a StaticTuple structure."
698
"\n This is used as StaticTuple(item1, item2, item3)"
699
"\n This is similar to tuple, less flexible in what it"
700
"\n supports, but also lighter memory consumption."
701
"\n Note that the constructor mimics the () form of tuples"
702
"\n Rather than the 'tuple()' constructor."
703
"\n eg. StaticTuple(a, b) == (a, b) == tuple((a, b))";
705
static PyMethodDef StaticTuple_methods[] = {
706
{"as_tuple", (PyCFunction)StaticTuple_as_tuple, METH_NOARGS, StaticTuple_as_tuple_doc},
707
{"intern", (PyCFunction)StaticTuple_Intern, METH_NOARGS, StaticTuple_Intern_doc},
708
{"_is_interned", (PyCFunction)StaticTuple__is_interned, METH_NOARGS,
709
StaticTuple__is_interned_doc},
710
{"from_sequence", (PyCFunction)StaticTuple_from_sequence,
711
METH_STATIC | METH_VARARGS,
712
"Create a StaticTuple from a given sequence. This functions"
713
" the same as the tuple() constructor."},
714
{"__reduce__", (PyCFunction)StaticTuple_reduce, METH_NOARGS, StaticTuple_reduce_doc},
715
{NULL, NULL} /* sentinel */
719
static PyNumberMethods StaticTuple_as_number = {
720
(binaryfunc) StaticTuple_add, /* nb_add */
724
0, /* nb_remainder */
741
static PySequenceMethods StaticTuple_as_sequence = {
742
(lenfunc)StaticTuple_length, /* sq_length */
745
(ssizeargfunc)StaticTuple_item, /* sq_item */
746
(ssizessizeargfunc)StaticTuple_slice, /* sq_slice */
748
0, /* sq_ass_slice */
752
/* TODO: Implement StaticTuple_as_mapping.
753
* The only thing we really want to support from there is mp_subscript,
754
* so that we could support extended slicing (foo[::2]). Not worth it
759
PyTypeObject StaticTuple_Type = {
760
PyObject_HEAD_INIT(NULL)
762
"bzrlib._static_tuple_c.StaticTuple", /* tp_name */
763
sizeof(StaticTuple), /* tp_basicsize */
764
sizeof(PyObject *), /* tp_itemsize */
765
(destructor)StaticTuple_dealloc, /* tp_dealloc */
770
(reprfunc)StaticTuple_repr, /* tp_repr */
771
&StaticTuple_as_number, /* tp_as_number */
772
&StaticTuple_as_sequence, /* tp_as_sequence */
773
0, /* tp_as_mapping */
774
(hashfunc)StaticTuple_hash, /* tp_hash */
779
0, /* tp_as_buffer */
780
/* Py_TPFLAGS_CHECKTYPES tells the number operations that they shouldn't
781
* try to 'coerce' but instead stuff like 'add' will check it arguments.
783
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* tp_flags*/
784
StaticTuple_doc, /* tp_doc */
785
/* gc.get_referents checks the IS_GC flag before it calls tp_traverse
786
* And we don't include this object in the garbage collector because we
787
* know it doesn't create cycles. However, 'meliae' will follow
788
* tp_traverse, even if the object isn't GC, and we want that.
790
(traverseproc)StaticTuple_traverse, /* tp_traverse */
792
StaticTuple_richcompare, /* tp_richcompare */
793
0, /* tp_weaklistoffset */
794
// without implementing tp_iter, Python will fall back to PySequence*
795
// which seems to work ok, we may need something faster/lighter in the
799
StaticTuple_methods, /* tp_methods */
804
0, /* tp_descr_get */
805
0, /* tp_descr_set */
806
0, /* tp_dictoffset */
809
StaticTuple_new_constructor, /* tp_new */
813
static PyMethodDef static_tuple_c_methods[] = {
819
setup_interned_tuples(PyObject *m)
821
_interned_tuples = (PyObject *)SimpleSet_New();
822
if (_interned_tuples != NULL) {
823
Py_INCREF(_interned_tuples);
824
PyModule_AddObject(m, "_interned_tuples", _interned_tuples);
830
setup_empty_tuple(PyObject *m)
833
if (_interned_tuples == NULL) {
834
fprintf(stderr, "You need to call setup_interned_tuples() before"
835
" setup_empty_tuple, because we intern it.\n");
837
// We need to create the empty tuple
838
stuple = (StaticTuple *)StaticTuple_New(0);
839
_empty_tuple = StaticTuple_Intern(stuple);
840
assert(_empty_tuple == stuple);
841
// At this point, refcnt is 2: 1 from New(), and 1 from the return from
842
// intern(). We will keep 1 for the _empty_tuple global, and use the other
843
// for the module reference.
844
PyModule_AddObject(m, "_empty_tuple", (PyObject *)_empty_tuple);
848
_StaticTuple_CheckExact(PyObject *obj)
850
return StaticTuple_CheckExact(obj);
854
setup_c_api(PyObject *m)
856
_export_function(m, "StaticTuple_New", StaticTuple_New,
857
"StaticTuple *(Py_ssize_t)");
858
_export_function(m, "StaticTuple_Intern", StaticTuple_Intern,
859
"StaticTuple *(StaticTuple *)");
860
_export_function(m, "StaticTuple_FromSequence", StaticTuple_FromSequence,
861
"StaticTuple *(PyObject *)");
862
_export_function(m, "_StaticTuple_CheckExact", _StaticTuple_CheckExact,
868
_workaround_pyrex_096(void)
870
/* Work around an incompatibility in how pyrex 0.9.6 exports a module,
871
* versus how pyrex 0.9.8 and cython 0.11 export it.
872
* Namely 0.9.6 exports import__simple_set_pyx and tries to
873
* "import _simple_set_pyx" but it is available only as
874
* "import bzrlib._simple_set_pyx"
875
* It is a shame to hack up sys.modules, but that is what we've got to do.
877
PyObject *sys_module = NULL, *modules = NULL, *set_module = NULL;
880
/* Clear out the current ImportError exception, and try again. */
882
/* Note that this only seems to work if somewhere else imports
883
* bzrlib._simple_set_pyx before importing bzrlib._static_tuple_c
885
set_module = PyImport_ImportModule("bzrlib._simple_set_pyx");
886
if (set_module == NULL) {
889
/* Add the _simple_set_pyx into sys.modules at the appropriate location. */
890
sys_module = PyImport_ImportModule("sys");
891
if (sys_module == NULL) {
894
modules = PyObject_GetAttrString(sys_module, "modules");
895
if (modules == NULL || !PyDict_Check(modules)) {
898
PyDict_SetItemString(modules, "_simple_set_pyx", set_module);
899
/* Now that we have hacked it in, try the import again. */
900
retval = import_bzrlib___simple_set_pyx();
902
Py_XDECREF(set_module);
903
Py_XDECREF(sys_module);
910
init_static_tuple_c(void)
914
StaticTuple_Type.tp_getattro = PyObject_GenericGetAttr;
915
if (PyType_Ready(&StaticTuple_Type) < 0)
918
m = Py_InitModule3("_static_tuple_c", static_tuple_c_methods,
919
"C implementation of a StaticTuple structure");
923
Py_INCREF(&StaticTuple_Type);
924
PyModule_AddObject(m, "StaticTuple", (PyObject *)&StaticTuple_Type);
925
if (import_bzrlib___simple_set_pyx() == -1
926
&& _workaround_pyrex_096() == -1)
930
setup_interned_tuples(m);
931
setup_empty_tuple(m);
935
// vim: tabstop=4 sw=4 expandtab