logoalt Hacker News

rpcope1last Thursday at 3:37 AM4 repliesview on HN

That's probably one of the more frustrating things about Python. Each release it gets all sorts of questionable new syntax (including the very strange pattern matching "feature" that kind of sucks compared to something like Erlang or Scala), but we never get real useful quality of life improvements for basic functional programming like TCO or multi line lambdas


Replies

throwaway81523last Thursday at 3:47 AM

Python has always been unashamedly imperative, with some functional features entering by slipping through the cracks. The pattern matching thing seemed ok to me when I tried it, but I haven't used it except briefly, since I'm still mostly on Python 3.9. Interestingly, Python has been losing users to Rust. I don't entirely understand that, other than everyone saying how Rust's tooling is so much better.

show 3 replies
dragonwriterlast Thursday at 4:48 AM

> we never get real useful quality of life improvements for basic functional programming like TCO or multi line lambdas

A lambda can be as big of an expression as you want, including spanning multiple lines; it can't (because it is an expression) include statements, which is only different than lambdas in most functional languages in that Python actually has statements.

show 1 reply
pinoy420last Thursday at 7:13 AM

The choice of “unique” verbs is weird too. Case match. Try except?

show 1 reply
jgalt212last Thursday at 3:40 AM

The utility value of multi-line lambdas is real, but the readability of these is terrible. And Python prizes readability. So you know where this initiative will end up.

show 2 replies