Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.
jgardner at jonathangardner.net
Wed Feb 17 01:19:07 CET 2010
On Feb 16, 11:41 am, Andrej Mitrovic <andrej.mitrov... at gmail.com>
> On Feb 16, 7:38 pm, Casey Hawthorne <caseyhHAMMER_T... at istar.ca>
> > Interesting talk on Python vs. Ruby and how he would like Python to
> > have just a bit more syntactic flexibility.
> > --
> > Regards,
> > Casey
> Gary's friend Geoffrey Grosenbach says in his blog post (which Gary
> linked to): "Python has no comparable equivalent to Ruby’s do end
> block. Python lambdas are limited to one line and can’t contain
> statements (for, if, def, etc.). Which leaves me wondering, what’s the
> I'm sorry, lambda's do support if's and for's. Also, lambda's are
> expressions, not statements, but you can pass them around, keep them
> in a dictionary if you want to. And if you need more than one line of
> statements, for crying out loud use a def? And who needs those "do-
> end" blocks anyway, trying to turn Python into Pascal?
I used to think anonymous functions (AKA blocks, etc...) would be a
nice feature for Python.
Then I looked at a stack trace from a different programming language
with lots of anonymous functions. (I believe it was perl.)
I became enlightened.
More information about the Python-list