summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 (GMT)
commit72d206776d34bcc38abbf16aa93c2d25ebec4df9 (patch)
treeb88b17cdf6d890bbefebe7736147b590ac00a8b4 /Objects/tupleobject.c
parent9eec489c4a021d181bc7ccc37921543114b69988 (diff)
downloadcpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.zip
cpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.tar.gz
cpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.tar.bz2
Remove "static forward" declaration. Move constructors
after the type objects.
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index c0c2056..10b7aaf 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -791,27 +791,6 @@ typedef struct {
PyTupleObject *it_seq; /* Set to NULL when iterator is exhausted */
} tupleiterobject;
-PyTypeObject PyTupleIter_Type;
-
-static PyObject *
-tuple_iter(PyObject *seq)
-{
- tupleiterobject *it;
-
- if (!PyTuple_Check(seq)) {
- PyErr_BadInternalCall();
- return NULL;
- }
- it = PyObject_GC_New(tupleiterobject, &PyTupleIter_Type);
- if (it == NULL)
- return NULL;
- it->it_index = 0;
- Py_INCREF(seq);
- it->it_seq = (PyTupleObject *)seq;
- _PyObject_GC_TRACK(it);
- return (PyObject *)it;
-}
-
static void
tupleiter_dealloc(tupleiterobject *it)
{
@@ -901,3 +880,22 @@ PyTypeObject PyTupleIter_Type = {
tupleiter_methods, /* tp_methods */
0,
};
+
+static PyObject *
+tuple_iter(PyObject *seq)
+{
+ tupleiterobject *it;
+
+ if (!PyTuple_Check(seq)) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+ it = PyObject_GC_New(tupleiterobject, &PyTupleIter_Type);
+ if (it == NULL)
+ return NULL;
+ it->it_index = 0;
+ Py_INCREF(seq);
+ it->it_seq = (PyTupleObject *)seq;
+ _PyObject_GC_TRACK(it);
+ return (PyObject *)it;
+}