[EMAIL PROTECTED] a écrit : > I would like to gauge interest in the following proposal: > > Problem: > > Assignment statements cannot be used as expressions.
This is by design. > Performing a list of mutually exclusive checks that require data > processing can cause excessive tabification. For example, consider > the following python snipet... > > temp = my_re1.match(exp) > if temp: > # do something with temp > else: > temp = my_re2.match(exp) > if temp: > # do something with temp > else: > temp = my_re3.match(exp) > if temp: > # do something with temp > else: > temp = my_re4.match(exp) OMG. actions = [ (my_re1, do_something_with_temp1), (my_re2, do_something_with_temp2), (my_re3, do_something_with_temp3), (my_re4, do_something_with_temp4), ] for my_re, do_something_with in actions: temp = my_re.match(exp): if temp: do_something_with(temp) break Having full-blown anonymous functions or Ruby/Smalltalk-like code blocks would be much more interesting IMHO. -- http://mail.python.org/mailman/listinfo/python-list