[Python-ideas] Statements vs Expressions... why?

Cliff Wells cliff at develix.com
Sun Sep 14 22:02:47 CEST 2008


On Sun, 2008-09-14 at 12:36 -0700, Josiah Carlson wrote:

> Agreed.  For all of the semantic and syntactic gymnastics and
> discussion about how statements -> expressions would make Python a
> better language, all I can conclude from the above is "I'm glad Python
> doesn't do that."

Well, realize that being able to do something doesn't make it the right
thing to do in a particular situation.   I don't think Arnaud's goal
here is to show that functional programming is bad, rather he's forcing
me to work out whether or not it could be done without breaking existing
syntax (and a fine job he's doing too).   The examples we've been
working through are testing specific cases.  It doesn't mean it would be
the recommended idiom for these cases.   

When I was testing the macro feature for Breve (a bad name for the
feature, I now realize), I wrote intentionally horrific code, simply to
test that the solution was general enough:

http://breve.twisty-industries.com/snippets/macro-madness

Would I ever do that in real life?  Only for testing =)

Cliff




More information about the Python-ideas mailing list