[Python-ideas] Adding list.pluck() (original) (raw)

Westley MartĂ­nez anikom15 at gmail.com
Sat Jun 2 20:50:21 CEST 2012


On Sat, Jun 02, 2012 at 09:01:53PM +0300, Serhiy Storchaka wrote:

On 02.06.12 19:06, Guido van Rossum wrote: >On Sat, Jun 2, 2012 at 8:54 AM, Mathias Panzenböck ><grosser.meister.morti at gmx.net> wrote: >>>>>from operator import itemgetter >>>>>map(itemgetter('name'),stooges) >>['moe', 'larry', 'curly'] > >If I saw this I would have to think a lot harder before I figured what >it meant. (Especially without the output example.)

And this is not true in Python 3. <map object at 0xb747970c>

map returns a generator in Python 3.



More information about the Python-ideas mailing list