Re:Sshole
by kazinator on Friday November 06, 2026 @06:48PM
(#50400090)
[delayed]
[ Parent
| on HN ]
Basically, you need the whole 'success and error types are different' in a language like Python if you make the return type something like "int | string", where 'string' stands for your error message.
Of course that breaks down, when the success type is also an error message, eg when you are looking up something in a catalogue of error messages.
Rust has no trouble with this, for exactly the reasons you line out.