On 21/08/2014 7:30 PM, icefap...@gmail.com wrote:
On Thursday, August 21, 2014 2:27:08 AM UTC-7, Marko Rauhamaa wrote:
In practice, your proposal would not make life easier for Python
programmers.

neither did the lambda, yours truly supposes?

alex23 disagrees. alex23 finds the lambda extremely convenient for things like sort, filter etc where alex23 wants to provide a function.

alex23 finds this to be very readable:

    odds_list = filter(lambda x: bool(x % 2), some_list)

By comparison, alex23 finds this to be more cumbersome for little gain:

    def odds_only(x):
        return bool(x % 2)
    odds_list = filter(odds_only, some_list)

alex23 finds most examples for multiline anonymous functions to be far more difficult to parse than the both restricted lambda form and the separate function approach:

    odds_list = filter((def(x):
        return bool(x % 2)), some_list)

alex23 isn't even sure if that's the correct format for your proposed syntax, or whether `, some_list)` has to appear on a separate line, or even if the () around the anonymous function is even necessary (alex23 assumed it was from your description of the closing parenthesis popping the "space-sensitivity-stack").
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to