Mercurial > cpython-lru_cache-weakref
annotate Objects/enumobject.c @ 31420:be56fc485e27 legacy-trunk
no reason not to use boilerplate.tex now that it names the PSF
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Fri, 23 Jan 2004 15:23:49 +0000 |
| parents | 682d1b67c7b5 |
| children | f04ccc288542 |
| rev | line source |
|---|---|
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 /* enumerate object */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 #include "Python.h" |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 typedef struct { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 PyObject_HEAD |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 long en_index; /* current index of enumeration */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 PyObject* en_sit; /* secondary iterator of enumeration */ |
| 29289 | 9 PyObject* en_result; /* result tuple */ |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 } enumobject; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 PyTypeObject PyEnum_Type; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 static PyObject * |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
17 enumobject *en; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 PyObject *seq = NULL; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 static char *kwlist[] = {"sequence", 0}; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:enumerate", kwlist, |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 &seq)) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
23 return NULL; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
24 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 en = (enumobject *)type->tp_alloc(type, 0); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 if (en == NULL) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 return NULL; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 en->en_index = 0; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 en->en_sit = PyObject_GetIter(seq); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 if (en->en_sit == NULL) { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 Py_DECREF(en); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 return NULL; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 } |
|
30835
562143c1c7ae
Use PyTuple_Pack() to simplify enumerate().
Raymond Hettinger <python@rcn.com>
parents:
29289
diff
changeset
|
34 en->en_result = PyTuple_Pack(2, Py_None, Py_None); |
| 29289 | 35 if (en->en_result == NULL) { |
| 36 Py_DECREF(en->en_sit); | |
| 37 Py_DECREF(en); | |
| 38 return NULL; | |
| 39 } | |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
40 return (PyObject *)en; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
41 } |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
42 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
43 static void |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
44 enum_dealloc(enumobject *en) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
45 { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
46 PyObject_GC_UnTrack(en); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
47 Py_XDECREF(en->en_sit); |
| 29289 | 48 Py_XDECREF(en->en_result); |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 en->ob_type->tp_free(en); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 } |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
51 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
52 static int |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
53 enum_traverse(enumobject *en, visitproc visit, void *arg) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 { |
| 29289 | 55 int err; |
| 56 | |
| 57 if (en->en_sit) { | |
| 58 err = visit(en->en_sit, arg); | |
| 59 if (err) | |
| 60 return err; | |
| 61 } | |
| 62 if (en->en_result) { | |
| 63 err = visit(en->en_result, arg); | |
| 64 if (err) | |
| 65 return err; | |
| 66 } | |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
67 return 0; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
68 } |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
69 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
70 static PyObject * |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
71 enum_next(enumobject *en) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
72 { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
73 PyObject *next_index; |
|
24261
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
74 PyObject *next_item; |
| 29289 | 75 PyObject *result = en->en_result; |
| 76 PyObject *it = en->en_sit; | |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
77 |
| 29289 | 78 next_item = (*it->ob_type->tp_iternext)(it); |
| 79 if (next_item == NULL) | |
|
24261
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
80 return NULL; |
|
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
81 |
|
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
82 next_index = PyInt_FromLong(en->en_index); |
|
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
83 if (next_index == NULL) { |
| 29289 | 84 Py_DECREF(next_item); |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
85 return NULL; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 } |
| 29289 | 87 en->en_index++; |
| 88 | |
| 89 if (result->ob_refcnt == 1) { | |
| 90 Py_INCREF(result); | |
| 91 Py_DECREF(PyTuple_GET_ITEM(result, 0)); | |
| 92 Py_DECREF(PyTuple_GET_ITEM(result, 1)); | |
| 93 } else { | |
| 94 result = PyTuple_New(2); | |
| 95 if (result == NULL) { | |
| 96 Py_DECREF(next_index); | |
| 97 Py_DECREF(next_item); | |
| 98 return NULL; | |
| 99 } | |
| 100 } | |
|
24261
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
101 PyTuple_SET_ITEM(result, 0, next_index); |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
102 PyTuple_SET_ITEM(result, 1, next_item); |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
103 return result; |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
104 } |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
105 |
|
23832
ed1ba37a46b7
Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents:
23285
diff
changeset
|
106 PyDoc_STRVAR(enum_doc, |
|
28711
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
107 "enumerate(iterable) -> iterator for index, value of iterable\n" |
|
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
108 "\n" |
|
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
109 "Return an enumerate object. iterable must be an other object that supports\n" |
|
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
110 "iteration. The enumerate object yields pairs containing a count (from\n" |
|
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
111 "zero) and a value yielded by the iterable argument. enumerate is useful\n" |
|
820d9570edeb
Add a useful docstring to enumerate.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
28320
diff
changeset
|
112 "for obtaining an indexed list: (0, seq[0]), (1, seq[1]), (2, seq[2]), ..."); |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
113 |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
114 PyTypeObject PyEnum_Type = { |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
115 PyObject_HEAD_INIT(&PyType_Type) |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
116 0, /* ob_size */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
117 "enumerate", /* tp_name */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
118 sizeof(enumobject), /* tp_basicsize */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
119 0, /* tp_itemsize */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
120 /* methods */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
121 (destructor)enum_dealloc, /* tp_dealloc */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
122 0, /* tp_print */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
123 0, /* tp_getattr */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
124 0, /* tp_setattr */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
125 0, /* tp_compare */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
126 0, /* tp_repr */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
127 0, /* tp_as_number */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
128 0, /* tp_as_sequence */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
129 0, /* tp_as_mapping */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
130 0, /* tp_hash */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
131 0, /* tp_call */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
132 0, /* tp_str */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
133 PyObject_GenericGetAttr, /* tp_getattro */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
134 0, /* tp_setattro */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
135 0, /* tp_as_buffer */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
136 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
137 Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
138 enum_doc, /* tp_doc */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
139 (traverseproc)enum_traverse, /* tp_traverse */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
140 0, /* tp_clear */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
141 0, /* tp_richcompare */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
142 0, /* tp_weaklistoffset */ |
|
28320
fd5ef7003469
Renamed PyObject_GenericGetIter to PyObject_SelfIter
Raymond Hettinger <python@rcn.com>
parents:
28308
diff
changeset
|
143 PyObject_SelfIter, /* tp_iter */ |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
144 (iternextfunc)enum_next, /* tp_iternext */ |
|
24261
27e94cacb43b
Remove the next() method -- one is supplied automatically by
Guido van Rossum <guido@python.org>
parents:
23832
diff
changeset
|
145 0, /* tp_methods */ |
|
23285
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
146 0, /* tp_members */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
147 0, /* tp_getset */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
148 0, /* tp_base */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
149 0, /* tp_dict */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
150 0, /* tp_descr_get */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
151 0, /* tp_descr_set */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
152 0, /* tp_dictoffset */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
153 0, /* tp_init */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
154 PyType_GenericAlloc, /* tp_alloc */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
155 enum_new, /* tp_new */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
156 PyObject_GC_Del, /* tp_free */ |
|
afe263672fd8
- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
157 }; |
|
30865
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
158 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
159 /* Reversed Object ***************************************************************/ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
160 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
161 typedef struct { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
162 PyObject_HEAD |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
163 long index; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
164 PyObject* seq; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
165 } reversedobject; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
166 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
167 static PyObject * |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
168 reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
169 { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
170 long n; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
171 PyObject *seq; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
172 reversedobject *ro; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
173 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
174 if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq)) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
175 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
176 |
|
30874
682d1b67c7b5
Optimize reversed(list) using a custom iterator.
Raymond Hettinger <python@rcn.com>
parents:
30865
diff
changeset
|
177 /* Special case optimization for xrange and lists */ |
|
682d1b67c7b5
Optimize reversed(list) using a custom iterator.
Raymond Hettinger <python@rcn.com>
parents:
30865
diff
changeset
|
178 if (PyRange_Check(seq) || PyList_Check(seq)) |
|
30865
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
179 return PyObject_CallMethod(seq, "__reversed__", NULL); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
180 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
181 if (!PySequence_Check(seq)) { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
182 PyErr_SetString(PyExc_TypeError, |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
183 "argument to reversed() must be a sequence"); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
184 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
185 } |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
186 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
187 n = PySequence_Size(seq); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
188 if (n == -1) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
189 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
190 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
191 ro = (reversedobject *)type->tp_alloc(type, 0); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
192 if (ro == NULL) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
193 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
194 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
195 ro->index = n-1; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
196 Py_INCREF(seq); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
197 ro->seq = seq; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
198 return (PyObject *)ro; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
199 } |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
200 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
201 static void |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
202 reversed_dealloc(reversedobject *ro) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
203 { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
204 PyObject_GC_UnTrack(ro); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
205 Py_XDECREF(ro->seq); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
206 ro->ob_type->tp_free(ro); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
207 } |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
208 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
209 static int |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
210 reversed_traverse(reversedobject *ro, visitproc visit, void *arg) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
211 { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
212 if (ro->seq) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
213 return visit((PyObject *)(ro->seq), arg); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
214 return 0; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
215 } |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
216 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
217 static PyObject * |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
218 reversed_next(reversedobject *ro) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
219 { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
220 PyObject *item; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
221 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
222 if (ro->index < 0) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
223 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
224 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
225 assert(PySequence_Check(ro->seq)); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
226 item = PySequence_GetItem(ro->seq, ro->index); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
227 if (item == NULL) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
228 return NULL; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
229 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
230 ro->index--; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
231 return item; |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
232 } |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
233 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
234 PyDoc_STRVAR(reversed_doc, |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
235 "reverse(sequence) -> reverse iterator over values of the sequence\n" |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
236 "\n" |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
237 "Return a reverse iterator"); |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
238 |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
239 PyTypeObject PyReversed_Type = { |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
240 PyObject_HEAD_INIT(&PyType_Type) |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
241 0, /* ob_size */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
242 "reversed", /* tp_name */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
243 sizeof(reversedobject), /* tp_basicsize */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
244 0, /* tp_itemsize */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
245 /* methods */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
246 (destructor)reversed_dealloc, /* tp_dealloc */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
247 0, /* tp_print */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
248 0, /* tp_getattr */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
249 0, /* tp_setattr */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
250 0, /* tp_compare */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
251 0, /* tp_repr */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
252 0, /* tp_as_number */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
253 0, /* tp_as_sequence */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
254 0, /* tp_as_mapping */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
255 0, /* tp_hash */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
256 0, /* tp_call */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
257 0, /* tp_str */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
258 PyObject_GenericGetAttr, /* tp_getattro */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
259 0, /* tp_setattro */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
260 0, /* tp_as_buffer */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
261 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
262 Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
263 reversed_doc, /* tp_doc */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
264 (traverseproc)reversed_traverse,/* tp_traverse */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
265 0, /* tp_clear */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
266 0, /* tp_richcompare */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
267 0, /* tp_weaklistoffset */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
268 PyObject_SelfIter, /* tp_iter */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
269 (iternextfunc)reversed_next, /* tp_iternext */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
270 0, /* tp_methods */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
271 0, /* tp_members */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
272 0, /* tp_getset */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
273 0, /* tp_base */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
274 0, /* tp_dict */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
275 0, /* tp_descr_get */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
276 0, /* tp_descr_set */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
277 0, /* tp_dictoffset */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
278 0, /* tp_init */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
279 PyType_GenericAlloc, /* tp_alloc */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
280 reversed_new, /* tp_new */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
281 PyObject_GC_Del, /* tp_free */ |
|
41c4e143e6e6
Implement and apply PEP 322, reverse iteration
Raymond Hettinger <python@rcn.com>
parents:
30835
diff
changeset
|
282 }; |
