FA-4611 / Iterator consumption / Open access
Zip longest distinguishes real none · case 01
The operation returns a result or retained state that violates this contract: Zip to exhaustion of both inputs and fill missing positions with a distinct string marker; present None is retained.
ROOT CAUSE
Ordinary zip discards the longer suffix.
VERIFIED REPAIR
Zip to exhaustion of both inputs and fill missing positions with a distinct string marker; present None is retained.
Unsuccessful approach: Replacing all None values with padding changes legitimate present None values.
Case contract
Zip to exhaustion of both inputs and fill missing positions with a distinct string marker; present None is retained. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.
Why this case matters
A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import itertools as it
from collections import deque
N = 1
observations = []
def solve(x, y=None):
return [list(v) for v in zip(x,y)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present None retained', solve([None], ['a', 'b']), [[None, 'a'], ['missing', 'b']])
check('empty left', solve([], ['a']), [['missing', 'a']])
check('empty both', solve([], []), [])
check('empty right', solve(['a'], []), [['a', 'missing']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| present None retained | [[None, 'a']] | [[None, 'a'], ['missing', 'b']] | Failed |
| empty left | [] | [['missing', 'a']] | Failed |
| empty both | [] | [] | Passed |
| empty right | [] | [['a', 'missing']] | Failed |
SHA-256 / 8020c7dc95a326c183cc14f113f7be8a2fb23849df01c9e3266457168bb1b562
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import itertools as it
from collections import deque
N = 1
observations = []
def solve(x, y=None):
return [["missing" if v is None else v for v in row] for row in it.zip_longest(x,y)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present None retained', solve([None], ['a', 'b']), [[None, 'a'], ['missing', 'b']])
check('empty left', solve([], ['a']), [['missing', 'a']])
check('empty both', solve([], []), [])
check('empty right', solve(['a'], []), [['a', 'missing']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| present None retained | [['missing', 'a'], ['missing', 'b']] | [[None, 'a'], ['missing', 'b']] | Failed |
| empty left | [['missing', 'a']] | [['missing', 'a']] | Passed |
| empty both | [] | [] | Passed |
| empty right | [['a', 'missing']] | [['a', 'missing']] | Passed |
SHA-256 / 9349a990a5ebebd0e09ad3c738d9d11ec2cbe40f3f4ba15a5527832aecc384c3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import itertools as it
from collections import deque
N = 1
observations = []
def solve(x, y=None):
return [list(v) for v in it.zip_longest(x,y,fillvalue="missing")]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present None retained', solve([None], ['a', 'b']), [[None, 'a'], ['missing', 'b']])
check('empty left', solve([], ['a']), [['missing', 'a']])
check('empty both', solve([], []), [])
check('empty right', solve(['a'], []), [['a', 'missing']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| present None retained | [[None, 'a'], ['missing', 'b']] | [[None, 'a'], ['missing', 'b']] | Passed |
| empty left | [['missing', 'a']] | [['missing', 'a']] | Passed |
| empty both | [] | [] | Passed |
| empty right | [['a', 'missing']] | [['a', 'missing']] | Passed |
SHA-256 / 43833478ff62aaf9c948c4e7488bddd56f3c4a0665bde704c5638acabe8dff2f
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:37:40.915869+00:00.
Case digest / aa74f86992813422a46fcb632c091f64ae5f49e13f0bd73e1c5b62ff7abf1c35