mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
This commit is contained in:
parent
cbcdfdc112
commit
f5b3e36493
14 changed files with 41 additions and 32 deletions
|
@ -220,7 +220,7 @@ builtin_filter(PyObject *self, PyObject *args)
|
|||
goto Fail_arg;
|
||||
|
||||
/* Guess a result list size. */
|
||||
len = _PyObject_LengthCue(seq);
|
||||
len = _PyObject_LengthHint(seq);
|
||||
if (len < 0) {
|
||||
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
|
||||
!PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
||||
|
@ -875,7 +875,7 @@ builtin_map(PyObject *self, PyObject *args)
|
|||
}
|
||||
|
||||
/* Update len. */
|
||||
curlen = _PyObject_LengthCue(curseq);
|
||||
curlen = _PyObject_LengthHint(curseq);
|
||||
if (curlen < 0) {
|
||||
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
|
||||
!PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
||||
|
@ -2111,7 +2111,7 @@ builtin_zip(PyObject *self, PyObject *args)
|
|||
len = -1; /* unknown */
|
||||
for (i = 0; i < itemsize; ++i) {
|
||||
PyObject *item = PyTuple_GET_ITEM(args, i);
|
||||
int thislen = _PyObject_LengthCue(item);
|
||||
int thislen = _PyObject_LengthHint(item);
|
||||
if (thislen < 0) {
|
||||
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
|
||||
!PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue