diff options
author | Armin Rigo <arigo@tunes.org> | 2006-02-11 21:32:43 (GMT) |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2006-02-11 21:32:43 (GMT) |
commit | f5b3e36493da275334e29afdbd238863697dca35 (patch) | |
tree | 9ddfdb941f79b23a7665f473df37f82f49a80981 /Objects | |
parent | cbcdfdc1129cdec27281f62e4494a05405354340 (diff) | |
download | cpython-f5b3e36493da275334e29afdbd238863697dca35.zip cpython-f5b3e36493da275334e29afdbd238863697dca35.tar.gz cpython-f5b3e36493da275334e29afdbd238863697dca35.tar.bz2 |
Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 6 | ||||
-rw-r--r-- | Objects/dictobject.c | 4 | ||||
-rw-r--r-- | Objects/enumobject.c | 4 | ||||
-rw-r--r-- | Objects/iterobject.c | 4 | ||||
-rw-r--r-- | Objects/listobject.c | 6 | ||||
-rw-r--r-- | Objects/rangeobject.c | 4 | ||||
-rw-r--r-- | Objects/setobject.c | 4 | ||||
-rw-r--r-- | Objects/tupleobject.c | 4 |
8 files changed, 18 insertions, 18 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 8a5166e..b794974 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -82,7 +82,7 @@ PyObject_Length(PyObject *o) #define PyObject_Length PyObject_Size int -_PyObject_LengthCue(PyObject *o) +_PyObject_LengthHint(PyObject *o) { int rv = PyObject_Size(o); if (rv != -1) @@ -92,7 +92,7 @@ _PyObject_LengthCue(PyObject *o) PyObject *err_type, *err_value, *err_tb, *ro; PyErr_Fetch(&err_type, &err_value, &err_tb); - ro = PyObject_CallMethod(o, "_length_cue", NULL); + ro = PyObject_CallMethod(o, "__length_hint__", NULL); if (ro != NULL) { rv = (int)PyInt_AsLong(ro); Py_DECREF(ro); @@ -1463,7 +1463,7 @@ PySequence_Tuple(PyObject *v) return NULL; /* Guess result size and allocate space. */ - n = _PyObject_LengthCue(v); + n = _PyObject_LengthHint(v); if (n < 0) { if (!PyErr_ExceptionMatches(PyExc_TypeError) && !PyErr_ExceptionMatches(PyExc_AttributeError)) { diff --git a/Objects/dictobject.c b/Objects/dictobject.c index cf88f34..1deb26c 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -2063,10 +2063,10 @@ dictiter_len(dictiterobject *di) return PyInt_FromLong(len); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef dictiter_methods[] = { - {"_length_cue", (PyCFunction)dictiter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)dictiter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 8c3eab1..7a5d1a1 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -252,10 +252,10 @@ reversed_len(reversedobject *ro) return PyInt_FromLong((seqsize < position) ? 0 : position); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef reversediter_methods[] = { - {"_length_cue", (PyCFunction)reversed_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)reversed_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/iterobject.c b/Objects/iterobject.c index fdee3ca..90dc3f0 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -87,10 +87,10 @@ iter_len(seqiterobject *it) return PyInt_FromLong(0); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef seqiter_methods[] = { - {"_length_cue", (PyCFunction)iter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)iter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/listobject.c b/Objects/listobject.c index 04671f4..8ba317a 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -775,7 +775,7 @@ listextend(PyListObject *self, PyObject *b) iternext = *it->ob_type->tp_iternext; /* Guess a result list size. */ - n = _PyObject_LengthCue(b); + n = _PyObject_LengthHint(b); if (n < 0) { if (!PyErr_ExceptionMatches(PyExc_TypeError) && !PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -2776,10 +2776,10 @@ listiter_len(listiterobject *it) return PyInt_FromLong(0); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef listiter_methods[] = { - {"_length_cue", (PyCFunction)listiter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)listiter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 3cc5504..cfd9100 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -268,10 +268,10 @@ rangeiter_len(rangeiterobject *r) return PyInt_FromLong(r->len - r->index); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef rangeiter_methods[] = { - {"_length_cue", (PyCFunction)rangeiter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)rangeiter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/setobject.c b/Objects/setobject.c index 2494bae..baa2d01 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -758,10 +758,10 @@ setiter_len(setiterobject *si) return PyInt_FromLong(len); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef setiter_methods[] = { - {"_length_cue", (PyCFunction)setiter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)setiter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 3fd311a..8ea29f0 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -860,10 +860,10 @@ tupleiter_len(tupleiterobject *it) return PyInt_FromLong(len); } -PyDoc_STRVAR(length_cue_doc, "Private method returning an estimate of len(list(it))."); +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef tupleiter_methods[] = { - {"_length_cue", (PyCFunction)tupleiter_len, METH_NOARGS, length_cue_doc}, + {"__length_hint__", (PyCFunction)tupleiter_len, METH_NOARGS, length_hint_doc}, {NULL, NULL} /* sentinel */ }; |