FAILURE MAP
← Case archive

FA-4871 / Call argument binding / Open access

Keyword only binding: Silently accepts unexpected keywords · case 01

Silently accepts unexpected keywords and changes the required Python-language result.

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

ROOT CAUSE

Silently accepts unexpected keywords. The executable reproducer isolates this operation from the rest of the contract.

VERIFIED REPAIR

Call f(a, *, b=10) and return [a,b]. Reject extra positional arguments, unknown keywords and repeated binding of a.

Unsuccessful approach: The alternative still fails because it overwrites a positional binding with a keyword binding.

Case contract

Call f(a, *, b=10) and return [a,b]. Reject extra positional arguments, unknown keywords and repeated binding of a. 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, *, b=10, **rest):
        return [a,b]
    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('second positional rejected', solve([1, 2], {}), 'TypeError')
check('all named', solve([], {'a': 1, 'b': 2}), [1, 2])
check('optional omitted', solve([1], {}), [1, 10])
check('unknown name', solve([1], {'c': 3}), 'TypeError')
check('a bound twice', solve([1], {'a': 2}), 'TypeError')
check('explicit None', solve([None], {'b': None}), [None, None])
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
second positional rejectedTypeErrorTypeErrorPassed
all named[1, 2][1, 2]Passed
optional omitted[1, 10][1, 10]Passed
unknown name[1, 10]TypeErrorFailed
a bound twiceTypeErrorTypeErrorPassed
explicit None[None, None][None, None]Passed

SHA-256 / fe8c0c5e0a78b7a91d0d56c6c7d061da37253126f473b7f274a65b2a263e395f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(args, kwargs):
    if len(args)>1: return "TypeError"
    values={"a":args[0]} if args else {}
    values.update(kwargs)
    if "a" not in values or set(values)-{"a","b"}: return "TypeError"
    return [values["a"],values.get("b",10)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('second positional rejected', solve([1, 2], {}), 'TypeError')
check('all named', solve([], {'a': 1, 'b': 2}), [1, 2])
check('optional omitted', solve([1], {}), [1, 10])
check('unknown name', solve([1], {'c': 3}), 'TypeError')
check('a bound twice', solve([1], {'a': 2}), 'TypeError')
check('explicit None', solve([None], {'b': None}), [None, None])
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
second positional rejectedTypeErrorTypeErrorPassed
all named[1, 2][1, 2]Passed
optional omitted[1, 10][1, 10]Passed
unknown nameTypeErrorTypeErrorPassed
a bound twice[2, 10]TypeErrorFailed
explicit None[None, None][None, None]Passed

SHA-256 / d270e61d88b35abc9cd1ab1796febf3a03dea1ea3f3d04ebfacae7671bab8e7e

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, *, b=10):
        return [a,b]
    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('second positional rejected', solve([1, 2], {}), 'TypeError')
check('all named', solve([], {'a': 1, 'b': 2}), [1, 2])
check('optional omitted', solve([1], {}), [1, 10])
check('unknown name', solve([1], {'c': 3}), 'TypeError')
check('a bound twice', solve([1], {'a': 2}), 'TypeError')
check('explicit None', solve([None], {'b': None}), [None, None])
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
second positional rejectedTypeErrorTypeErrorPassed
all named[1, 2][1, 2]Passed
optional omitted[1, 10][1, 10]Passed
unknown nameTypeErrorTypeErrorPassed
a bound twiceTypeErrorTypeErrorPassed
explicit None[None, None][None, None]Passed

SHA-256 / 9c02d25496faa5bb1fd109dd76ed2b2ffc3bdc873b6d14978860386fb86b583c

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

Case digest / 3908d96699fbe6d9c45b730d2d08bfda221ca7002155566785024e9fc63e5a18