3 ms·
And it takes twice the token count and lowered readability for no gain whatsoever.
by masklinn 15y ago
And it takes twice the token count and lowered readability for no gain whatsoever.
- burgerbrain 15y agoNo gain at all? How do you figure?
- olavk 15y agoTwice the token count? How did you get that?
- cyrus_ 15y agofoo = lambda x: lambda y: x + y bar = foo(10) This is perfectly correct Python code too if you prefer. The only real thing with Python's lambdas is that, because Python makes a distinction between statements and expressions, you can't easily do things like use temporary variables inside a lambda, but cases like that are rare and are typically more readable with a separate standalone function definition anyway.