FAILURE MAP
← Case archive

FA-5111 / Method resolution / Open access

Classmethod dynamic binding: Uses an ordinary instance method in place of a classmethod · case 01

Uses an ordinary instance method in place of a classmethod and changes the required Python-language result.

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

ROOT CAUSE

Uses an ordinary instance method in place of a classmethod. The executable reproducer isolates this operation from the rest of the contract.

THE FAILURE

Uses an ordinary instance method in place of a classmethod. The executable reproducer isolates this operation from the rest of the contract.

Unsuccessful approach: The alternative still fails because it uses the defining Base class instead of the bound subclass.

Case contract

An inherited classmethod binds the accessing class, including access through an instance or a saved bound method. Return [bound class name,its label,suffix]. 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(mode, suffix):
    class Base:
        label='base'
    
        def read(cls,suffix): return [cls.__name__,cls.label,suffix]
    class Child(Base): label='child'
    try:
        if mode=='base': return Base.read(suffix)
        if mode=='child': return Child.read(suffix)
        if mode=='instance': return Child().read(suffix)
        bound=Child.read
        return bound(suffix)
    except (TypeError,AttributeError) as exc:
        return type(exc).__name__
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base access', solve('base', 'x'), ['Base', 'base', 'x'])
check('subclass access', solve('child', 'y'), ['Child', 'child', 'y'])
check('instance access', solve('instance', None), ['Child', 'child', None])
check('saved bound method', solve('saved', 0), ['Child', 'child', 0])
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
base accessTypeError['Base', 'base', 'x']Failed
subclass accessTypeError['Child', 'child', 'y']Failed
instance accessAttributeError['Child', 'child', None]Failed
saved bound methodTypeError['Child', 'child', 0]Failed

SHA-256 / 9476c287760c09e188e4ce4cd681692bbc34c060c262a7d29090618edeb05ef5

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(mode, suffix):
    class Base:
        label='base'
        @classmethod
        def read(cls,suffix): return ['Base',Base.label,suffix]
    class Child(Base): label='child'
    try:
        if mode=='base': return Base.read(suffix)
        if mode=='child': return Child.read(suffix)
        if mode=='instance': return Child().read(suffix)
        bound=Child.read
        return bound(suffix)
    except (TypeError,AttributeError) as exc:
        return type(exc).__name__
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base access', solve('base', 'x'), ['Base', 'base', 'x'])
check('subclass access', solve('child', 'y'), ['Child', 'child', 'y'])
check('instance access', solve('instance', None), ['Child', 'child', None])
check('saved bound method', solve('saved', 0), ['Child', 'child', 0])
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
base access['Base', 'base', 'x']['Base', 'base', 'x']Passed
subclass access['Base', 'base', 'y']['Child', 'child', 'y']Failed
instance access['Base', 'base', None]['Child', 'child', None]Failed
saved bound method['Base', 'base', 0]['Child', 'child', 0]Failed

SHA-256 / 2048e0e5f3858c1098b86aec6e82d41de806f05a23282ce22c4fe22fc444e707

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 79f5eabdc90815b63450ad15760999af15a2789d7c9a92c0872d1a0aa023ac9c