FA-5116 / Method resolution / Open access
Classmethod dynamic binding: Uses the defining Base class instead of the bound subclass · case 01
Uses the defining Base class instead of the bound subclass and changes the required Python-language result.
ROOT CAUSE
Uses the defining Base class instead of the bound subclass. The executable reproducer isolates this operation from the rest of the contract.
VERIFIED REPAIR
An inherited classmethod binds the accessing class, including access through an instance or a saved bound method. Return [bound class name,its label,suffix].
Unsuccessful approach: The alternative still fails because it reports the bound class metaclass instead of the class name.
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'
@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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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
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 [type(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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| base access | ['type', 'base', 'x'] | ['Base', 'base', 'x'] | Failed |
| subclass access | ['type', 'child', 'y'] | ['Child', 'child', 'y'] | Failed |
| instance access | ['type', 'child', None] | ['Child', 'child', None] | Failed |
| saved bound method | ['type', 'child', 0] | ['Child', 'child', 0] | Failed |
SHA-256 / e80ebf3120618dc53b7a2e38fae56b40d501c2b35975a7d875e6c26e41054999
3 / The verified repair
Exit 0"""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 [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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| base access | ['Base', 'base', 'x'] | ['Base', 'base', 'x'] | Passed |
| subclass access | ['Child', 'child', 'y'] | ['Child', 'child', 'y'] | Passed |
| instance access | ['Child', 'child', None] | ['Child', 'child', None] | Passed |
| saved bound method | ['Child', 'child', 0] | ['Child', 'child', 0] | Passed |
SHA-256 / 7f30de44638b8a60d774a651f2944bc1d879f12c49eeda25f27204a7ea91a750
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.265647+00:00.
Case digest / e77bae31e3943fed61b77e4cf836b4e2343296079bed20d5a55d6108f48c550e