FAILURE MAP
← Case archive

FA-4941 / Call argument binding / Open access

Keyword unpacking collisions: Coerces non-string unpacked keyword names into strings · case 01

Coerces non-string unpacked keyword names into strings and changes the required Python-language result.

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

ROOT CAUSE

Coerces non-string unpacked keyword names into strings. The executable reproducer isolates this operation from the rest of the contract.

VERIFIED REPAIR

Invoke f(**left, **right), returning ordered keyword pairs. Reject any duplicate keyword across mappings even when values agree; keys must be strings.

Unsuccessful approach: The alternative still fails because it rejects an empty string although variadic keywords accept it.

Case contract

Invoke f(**left, **right), returning ordered keyword pairs. Reject any duplicate keyword across mappings even when values agree; keys must be strings. 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(left, right):
    def f(**kw): return [[k,v] for k,v in kw.items()]
    try: return f(**{str(k):v for k,v in left.items()},**{str(k):v for k,v in right.items()})
    except TypeError: return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate equal rejected', solve({'a': 1}, {'a': 1}), 'TypeError')
check('duplicate different rejected', solve({'a': 1}, {'a': 2}), 'TypeError')
check('integer key rejected', solve({1: 'v'}, {}), 'TypeError')
check('empty name legal', solve({'': 2}, {}), [['', 2]])
check('hyphenated name legal', solve({'a-b': 3}, {}), [['a-b', 3]])
check('left then right order', solve({'z': 1}, {'a': 2}), [['z', 1], ['a', 2]])
check('empty expansions', solve({}, {}), [])
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
duplicate equal rejectedTypeErrorTypeErrorPassed
duplicate different rejectedTypeErrorTypeErrorPassed
integer key rejected[['1', 'v']]TypeErrorFailed
empty name legal[['', 2]][['', 2]]Passed
hyphenated name legal[['a-b', 3]][['a-b', 3]]Passed
left then right order[['z', 1], ['a', 2]][['z', 1], ['a', 2]]Passed
empty expansions[][]Passed

SHA-256 / 14175c64efb5eef1c840ffde8488b61656bc884a55c3a8408144030d2a487878

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(left, right):
    if "" in left or "" in right: return "TypeError"
    def f(**kw): return [[k,v] for k,v in kw.items()]
    try: return f(**left, **right)
    except TypeError: return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate equal rejected', solve({'a': 1}, {'a': 1}), 'TypeError')
check('duplicate different rejected', solve({'a': 1}, {'a': 2}), 'TypeError')
check('integer key rejected', solve({1: 'v'}, {}), 'TypeError')
check('empty name legal', solve({'': 2}, {}), [['', 2]])
check('hyphenated name legal', solve({'a-b': 3}, {}), [['a-b', 3]])
check('left then right order', solve({'z': 1}, {'a': 2}), [['z', 1], ['a', 2]])
check('empty expansions', solve({}, {}), [])
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
duplicate equal rejectedTypeErrorTypeErrorPassed
duplicate different rejectedTypeErrorTypeErrorPassed
integer key rejectedTypeErrorTypeErrorPassed
empty name legalTypeError[['', 2]]Failed
hyphenated name legal[['a-b', 3]][['a-b', 3]]Passed
left then right order[['z', 1], ['a', 2]][['z', 1], ['a', 2]]Passed
empty expansions[][]Passed

SHA-256 / dc992ef595b60c3352429bc24dd0826127c6cc19567fb1bada5cd71e0a2f154a

3 / The verified repair

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

N = 1
observations = []
def solve(left, right):
    def f(**kw): return [[k,v] for k,v in kw.items()]
    try: return f(**left, **right)
    except TypeError: return "TypeError"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate equal rejected', solve({'a': 1}, {'a': 1}), 'TypeError')
check('duplicate different rejected', solve({'a': 1}, {'a': 2}), 'TypeError')
check('integer key rejected', solve({1: 'v'}, {}), 'TypeError')
check('empty name legal', solve({'': 2}, {}), [['', 2]])
check('hyphenated name legal', solve({'a-b': 3}, {}), [['a-b', 3]])
check('left then right order', solve({'z': 1}, {'a': 2}), [['z', 1], ['a', 2]])
check('empty expansions', solve({}, {}), [])
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
duplicate equal rejectedTypeErrorTypeErrorPassed
duplicate different rejectedTypeErrorTypeErrorPassed
integer key rejectedTypeErrorTypeErrorPassed
empty name legal[['', 2]][['', 2]]Passed
hyphenated name legal[['a-b', 3]][['a-b', 3]]Passed
left then right order[['z', 1], ['a', 2]][['z', 1], ['a', 2]]Passed
empty expansions[][]Passed

SHA-256 / 66403a424f3d7bcbea36c1325f0130ea8ab28a2ffb7d260e9291010cf9b47f8a

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

Case digest / f1d4944c2a5ad0ffd67d8008d572610dff476a07735d11a8bd7905b538241a69