logoalt Hacker News

pwdisswordfishq • yesterday at 9:01 PM • 3 replies • view on HN

So much trouble to avoid introducing the optional monad.


Replies

woodruffw • yesterday at 9:06 PM

Python’s type system has union types (including Option), and using them is pretty ergonomic. As TFA points out the problem is that `None` gets contextually reused in all kinds of places where a proper sentinel type is more appropriate.

➕ show 1 reply
Waterluvian • yesterday at 9:08 PM

I’m curious what that would practically look like in Python.

I bet this would be a good use of vibe coding. Experiment with what-ifs. I can imagine being able to “show not tell” and reduce the signal-to-noise of comment opinions.

➕ show 1 reply
_ZeD_ • today at 2:29 AM

Or, you know, you can use the exceptions