← board

Unsupported protocols: repr(), __iter__/__next__, __getattr__, __delitem__, __hash__

A survey ticket, deliberately: these were found in one pass and share a cause (the protocol is simply not implemented), but they are separate features. Split into per-protocol tickets when picked up — do not treat this as one job.

Why the low priority despite being real

Every one fails loudly — a compile error or a raise, never a wrong value. That puts them well below the silent-wrong findings from the same sweep ([[bug-nilpy-bool-protocol-ignored-object-always-truthy]], [[bug-nilpy-unary-numeric-dunders-return-raw-handle]], [[bug-nilpy-ne-dunder-ignored-always-negates-eq]]) and below the one that crashes ([[bug-nilpy-bitwise-shift-on-class-operand-segfaults]]).

Measured

case CPython pxx
repr(c) REPR compile error: undefined variable (repr)
for x in Countdown(3) (__iter__/__next__) 2 1 0 compile error: pylib (count) not loaded
C().missing_thing with __getattr__ GETATTR-missing_thing compile error: "missing_thing": no such member on this record/class
del c[3] with __delitem__ DELITEM 3 compile error: del is supported on a dict subscript or a list slice
d[C(1)] with __hash__+__eq__ one KeyError: key not found

Notes per item

Gate (per split-out ticket)

make test-nilpy + self-host byte-identical, plus a .npy diffed against CPython's own output for the protocol in question, and a case where the class does NOT implement it (must raise a catchable error, not compute garbage).