Convert iterator __len__() methods to a private API.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index dca8555..3e5f4eb 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -221,7 +221,7 @@
goto Fail_arg;
/* Guess a result list size. */
- len = PyObject_Size(seq);
+ len = _PyObject_LengthCue(seq);
if (len < 0) {
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
!PyErr_ExceptionMatches(PyExc_AttributeError)) {
@@ -873,7 +873,7 @@
}
/* Update len. */
- curlen = PyObject_Size(curseq);
+ curlen = _PyObject_LengthCue(curseq);
if (curlen < 0) {
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
!PyErr_ExceptionMatches(PyExc_AttributeError)) {
@@ -2108,7 +2108,7 @@
len = -1; /* unknown */
for (i = 0; i < itemsize; ++i) {
PyObject *item = PyTuple_GET_ITEM(args, i);
- int thislen = PyObject_Size(item);
+ int thislen = _PyObject_LengthCue(item);
if (thislen < 0) {
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
!PyErr_ExceptionMatches(PyExc_AttributeError)) {