Found by /verify-implementation plan-0ca7b7 (2026-09-26), measured @ 61bf20f with the built sharpyc; pre-existing at BASE acd1d40 unless noted.
class Snake:
x: int
def f(ok: bool) -> Snake !ValueError:
if ok:
return Ok(Snake())
return Err(ValueError("bad"))
def main():
print(f(True)) # Ok(R2.Snake) (BASE: Ok(R2+Snake))
print(f(False)) # Err(Sharpy.ValueError: bad)
print(Some(Snake())) # <__main__.Snake object> (routed by #2005 in plan-0ca7b7)
print(repr(f(True))) # Ok(R2.Snake)
Also print(json.loads[Snake]('{"x": 4}')) prints Ok(Tz.Snake). P11f's class contract says every runtime spelling of a value comes from the one python-name/repr channel (PyFormat, IRepr). Result.cs's ToString formats the payload/error with .NET ToString, so the CLR type name leaks. Expected: Ok(<__main__.Snake object>), and for Err the payload's repr (Err(ValueError('bad'))). The exact spelling needs a spec line, since result_types has none. Sibling cell of #2005 and #2006; the P11f matrix had Optional rows but no Result rows.
Found by /verify-implementation plan-0ca7b7 (2026-09-26), measured @ 61bf20f with the built sharpyc; pre-existing at BASE acd1d40 unless noted.
Also
print(json.loads[Snake]('{"x": 4}'))printsOk(Tz.Snake). P11f's class contract says every runtime spelling of a value comes from the one python-name/repr channel (PyFormat,IRepr).Result.cs's ToString formats the payload/error with .NET ToString, so the CLR type name leaks. Expected:Ok(<__main__.Snake object>), and for Err the payload's repr (Err(ValueError('bad'))). The exact spelling needs a spec line, since result_types has none. Sibling cell of #2005 and #2006; the P11f matrix had Optional rows but no Result rows.