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

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Mar 24 23:58:19 CET 2014


On Tue, 25 Mar 2014 06:22:28 +1100, Chris Angelico wrote:

> Aside: You'll often hear people talking about "map-reduce" with big
> data. Python supports that. Look!
> 
>>>> map.__reduce__
> <method '__reduce__' of 'map' objects>
> 
> Oh wait, that's nothing to do with reduce()...
> 
> *ducks for cover*

Ha ha, very funny :-P


http://code.activestate.com/recipes/577676-dirt-simple-mapreduce/




-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list