Better HN
topnewbestaskshowjobs
Log inSign up

demetri

10 karma · joined Feb 25, 2017 (9y ago) · 1 submissions

Submissions

comment 9y ago · link · parent

I am mostly confused by this. The author started out with a friend's question about an Either implementation and ended up with an enumeration and an option.

Enumerations are useful for a number of reasons in typed, compiled languages (I guess they provide readability in Python), but they are not the same as monads (of which Either is one type). I am not a Python developer, but as far as I can tell, this implementation gets you none of the real benefits that an a true Either implementation would get you in terms of functional goodness.

Am I missing something here? Is there some kind of Python magic that makes this better than just propagating the exception?