[Python-Dev] map(None, ...) in tutorial

Neil Schemenauer nas at python.ca
Thu Aug 14 16:04:47 EDT 2003


Raymond Hettinger wrote:
> No objections, just a couple of thoughts:
> 
> * [(x, square(x) for x in seq]  # this is much nicer

That example is already in the listcomp section of the tutorial.  Now
but I'm wondering if the whole section on multiple arguments to map()
should be removed from the tutorial.  I don't think it's important for
new users to learn it.

> * map(None, 'abc', range(5))  # demonstrates None fill-in 
>                                               # (which zip() doesn't have).

The None fill-in behavior is pretty advanced for the tutorial.  I don't
think I've ever written a map(None, ...) expression that wasn't better
expressed with the newer zip() builtin.

  Neil



More information about the Python-Dev mailing list