Re:Show HN: Python library for functional programming
by lmm on Thursday December 14, 2017 @11:45AM
(#15923761)
Python has lambdas so you can still write:
Even without that, returning a "foo" that has to be explicitly unwrapped makes for a safer API than having "foo" be sometimes a valid result and sometimes silently an error instead.
[ Parent
| on HN ]
Re:Show HN: Python library for functional programming
by catnaroek on Thursday December 14, 2017 @02:28PM
(#15925955)
> Python has lambdas so you can still write: (snippet)
Do you seriously consider this less of a hassle than branching on a frigging bit?
Re:Show HN: Python library for functional programming
by lmm on Thursday December 14, 2017 @05:20PM
(#15927739)
I think single entry/single exit is very valuable, and worth a bit of clunkiness for. And the branch version is also pretty clunky: either the long-winded "return ", abuse of "and"/"or", or the weirdly backwards expression version of "if" that Python has.