~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Objects/rangeobject.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
        return rtn;
130
130
}
131
131
 
 
132
/* Pickling support */
 
133
static PyObject *
 
134
range_reduce(rangeobject *r, PyObject *args)
 
135
{
 
136
        return Py_BuildValue("(O(iii))", Py_TYPE(r),
 
137
                             r->start,
 
138
                             r->start + r->len * r->step,
 
139
                             r->step);
 
140
}
 
141
 
132
142
static PySequenceMethods range_as_sequence = {
133
143
        (lenfunc)range_length,  /* sq_length */
134
144
        0,                      /* sq_concat */
145
155
 
146
156
static PyMethodDef range_methods[] = {
147
157
        {"__reversed__",        (PyCFunction)range_reverse, METH_NOARGS, reverse_doc},
 
158
        {"__reduce__",          (PyCFunction)range_reduce, METH_VARARGS},
148
159
        {NULL,          NULL}           /* sentinel */
149
160
};
150
161