GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Callable iterator can SystemError if call exhausts the iterator · Issue #101892 · python/cpython Closed Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportIf the callable of a callable iterator (with sentinel) exhausts the iterator itself during the call, a SystemError occurs.
def bug(): if bug.clear: return 1 else: bug.clear = True list(bug.iterator) return 0 bug.iterator = iter(bug, 1) bug.clear = False next(bug.iterator) Likely cause
static PyObject *
calliter_iternext(calliterobject *it)
{
PyObject *result;
if (it->it_callable == NULL) {
return NULL;
}
+ result = _PyObject_CallNoArgs(it->it_callable);
if (result != NULL) {
int ok;
+ ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
if (ok == 0) {
return result; /* Common case, fast path */
}
(...)Your environmentAppears to affect 3.7-3.12 Linked PRsActivity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |