FAILURE MAP
← Case archive

FA-4911 / Call argument binding / Open access

Positional name in varkw: Drops the legal same-named entry from variadic keywords · case 01

Drops the legal same-named entry from variadic keywords and changes the required Python-language result.

Verified by executionVariant 1 · 5 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Drops the legal same-named entry from variadic keywords. The executable reproducer isolates this operation from the rest of the contract.

VERIFIED REPAIR

Call f(a, /, **rest), returning the positional a and the ordered [name,value] keyword pairs. A keyword named a belongs to rest.

Unsuccessful approach: The alternative still fails because it allows the required positional value to be supplied through keyword rest.

Case contract

Call f(a, /, **rest), returning the positional a and the ordered [name,value] keyword pairs. A keyword named a belongs to rest. Inputs use the finite Python types shown in the fixtures. An error string denotes the specified caught exception, not an unhandled process failure.

Why this case matters

Runs Python standard-library language operations in a deterministic local reproducer. Literal expected answers are authored independently. Related defects share an evaluation group to avoid benchmark split leakage.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(args, kwargs):
    def f(a, /, **rest):
        return [a,[[k,v] for k,v in rest.items() if k!="a"]]
    try:
        return f(*args, **kwargs)
    except TypeError:
        return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('same spelling legal', solve([1], {'a': 2}), [1, [['a', 2]]])
check('ordered kwargs', solve([1], {'z': 0, 'a': 3, 'b': None}), [1, [['z', 0], ['a', 3], ['b', None]]])
check('no keywords', solve([None], {}), [None, []])
check('keyword cannot supply positional', solve([], {'a': 2}), 'TypeError')
check('too many positions', solve([1, 2], {}), 'TypeError')
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 fixtureActualExpectedOutcome
same spelling legal[1, []][1, [['a', 2]]]Failed
ordered kwargs[1, [['z', 0], ['b', None]]][1, [['z', 0], ['a', 3], ['b', None]]]Failed
no keywords[None, []][None, []]Passed
keyword cannot supply positionalTypeErrorTypeErrorPassed
too many positionsTypeErrorTypeErrorPassed

SHA-256 / 544ed1585fc15eea4d2965343550a57cfd6cdc26f522a4d4821924bc5d9dcbf6

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(args, kwargs):
    def f(a=None, **rest):
        return [a,[[k,v] for k,v in rest.items()]]
    try:
        return f(*args, **kwargs)
    except TypeError:
        return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('same spelling legal', solve([1], {'a': 2}), [1, [['a', 2]]])
check('ordered kwargs', solve([1], {'z': 0, 'a': 3, 'b': None}), [1, [['z', 0], ['a', 3], ['b', None]]])
check('no keywords', solve([None], {}), [None, []])
check('keyword cannot supply positional', solve([], {'a': 2}), 'TypeError')
check('too many positions', solve([1, 2], {}), 'TypeError')
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 fixtureActualExpectedOutcome
same spelling legalTypeError[1, [['a', 2]]]Failed
ordered kwargsTypeError[1, [['z', 0], ['a', 3], ['b', None]]]Failed
no keywords[None, []][None, []]Passed
keyword cannot supply positional[2, []]TypeErrorFailed
too many positionsTypeErrorTypeErrorPassed

SHA-256 / 17abc90bc48d877fb7a8abd6c5172f21896c4756ee7f3e0110a314daa026592e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(args, kwargs):
    def f(a, /, **rest):
        return [a,[[k,v] for k,v in rest.items()]]
    try:
        return f(*args, **kwargs)
    except TypeError:
        return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('same spelling legal', solve([1], {'a': 2}), [1, [['a', 2]]])
check('ordered kwargs', solve([1], {'z': 0, 'a': 3, 'b': None}), [1, [['z', 0], ['a', 3], ['b', None]]])
check('no keywords', solve([None], {}), [None, []])
check('keyword cannot supply positional', solve([], {'a': 2}), 'TypeError')
check('too many positions', solve([1, 2], {}), 'TypeError')
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 fixtureActualExpectedOutcome
same spelling legal[1, [['a', 2]]][1, [['a', 2]]]Passed
ordered kwargs[1, [['z', 0], ['a', 3], ['b', None]]][1, [['z', 0], ['a', 3], ['b', None]]]Passed
no keywords[None, []][None, []]Passed
keyword cannot supply positionalTypeErrorTypeErrorPassed
too many positionsTypeErrorTypeErrorPassed

SHA-256 / ef97a8c58608fd9b26082c9be6909a0f7cf0346da7ea7de59624a23f50058912

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:44.157364+00:00.

Case digest / 0fdba88ff8f2ed46953dfefb84bffd1f1e955c7824ecb71934d18f093f6d81b8