Mapping None. Why?

Robert Kern robert.kern at gmail.com
Thu Jun 12 15:47:15 EDT 2008


Ian Kelly wrote:
> On Thu, Jun 12, 2008 at 1:05 PM, Paddy <paddy3118 at googlemail.com> wrote:
>> Iam wondering why the peculiar behavior of map when the function in
>> given as None:
> 
> Because that's the way it's always been!  Seriously, I don't know.  I
> can tell you that it's going away in Python 3.0, though.

There was a time before zip(). Basically, it's a really useful feature, and the 
original implementor thought that map() was a reasonable place to put it; it's a 
somewhat natural outgrowth of the map(func, list1, list2, ... listn) semantics. 
Since then, after more thought was put into it, it was realized that a separate 
builtin function is more appropriate for this common use, and thus zip() was 
born and map(None, ...) was deprecated.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list