May-03-2017, 04:26 PM
(May-03-2017, 04:51 AM)micseydel Wrote: I feel embarrassed to say this but Java's lambdas put Python's to shame
You shouldn't be embarrassed about that, it's pretty common knowledge that python has some of the worst lambda support. Every time someone tries different syntax for it, gvr shoots it down. And for good reason, because they all look pretty ugly (similar to what I'm running into here: https://python-forum.io/Thread-How-do-yo...d-chaining).
Which kind of just kills fp, since naming all the little functions you pass around loses a lot of meaning, since you end up giving the functions stupid names like "temp" or "item_filter" just so you can have two line functions in a few places.
Even for single line functions,
lambda
is a heck of a lot of characters. I think I'd just prefer parenthases personally, maybe like: items = filter( (item): len(item)>2, items)
.But these are all minor arguments. Really, I'm not sure what a good answer would look like while still having whitespace matter.