Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 24 20:32:01 EDT 2014


On 25/03/2014 00:16, Mark H Harris wrote:
> On 3/24/14 7:11 PM, Chris Angelico wrote:
>> On Tue, Mar 25, 2014 at 10:56 AM, Mark H
>> Harris<harrismh777 at gmail.com>  wrote:
>>> What is needed is the explicit closure "grab" recommended by ChrisA.
>>
>> Which does work. You do know why, right?
>
> Sure.  ... but again, that's not the point. The point is NOT can you
> explain why it works, the point is that as a lambda construct it is NOT
> clear why it works, and because the construct does not match what lambda
> users might expect (naturally) there are *constant* questions about it.
>
> So, again, I'll restate that the community might consider (over time)
> whether the confusion created by lambda in python is worth the time and
> trouble to maintain the construct in the language. Is the value add
> worth the cost of confusion. I don't think so; others are bound to
> disagree.
>
> marcus

I'd vote to have lambda taken out of the language if it meant avoiding 
tedious threads like this one :(

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com





More information about the Python-list mailing list