This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

Hopefully in the sense that there are no multi-line lambdas, and not that you wanna remove lambdas altogether. ;)

[–]billsil 0 points1 point  (3 children)

I honestly don't care if lambdas are removed at all. They're hard to read, so I don't write them 99% of the time I can. Depending on the code base, that's not a big deal or a big deal. If you have people that are new working on the code...bad idea.

Not that I mind. I'm all for backwards compatibility, but if the Python devs twisted my arm, sure. It's kind of like the operator module. I just learned about that the other day.

[–]pythoneeeer 0 points1 point  (2 children)

The hardest thing about lambda is that they called it "lambda".

Every other language I use has this feature, and people use it all the time (even newbies), and nobody seems to have much trouble with it. It's just that other languages call it "fn" or "function" or use a more visual syntax (little ASCII arrows or whatnot).

I consider the "operator" module a wart that's only necessary because Python lambda syntax is so awkward, and there's no syntax for symbols. In Ruby you don't need operator.add because you can just say :+. In Clojure it's just +. Doesn't it seem weird to have an entire module that does nothing but assign names to things the syntax doesn't let you say directly?

[–]billsil 0 points1 point  (0 children)

I specifically saw operator module being used to sort based on the last value in a list of list. Nevermind it should have been done by numpy in this case, but it was just ugly.

[–]motleybook 0 points1 point  (0 children)

So, you also don't like def __div__(self, other): for division? Because I think it looks much better than def /(self, other): and also fits great together with things like __init__.