On Jun 12, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Paddy" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> |
> | Iam wondering why the peculiar behavior of map when the function in
> | given as None:
>
> The 'peculiar behavior' is the same as zip (except for padding short
> iterators versus truncating long iterators.  Map was added years before
> zip.  After that, map(None,...) was kept for back compatibility.
>
> In 3.0, the doc for map is
> "Return an iterator that applies function to every item of iterable,
> yielding the results. If additional iterable arguments are passed, function
> must take that many arguments and is applied to the items from all
> iterables in parallel. With multiple iterables, the iterator stops when the
> shortest iterable is exhausted."
>
> Using a map defined with None raises
> TypeError: 'NoneType' object is not callable
>
> tjr

I really should get into the habit of reading the 3.0 docs before
asking questions :-)

My original question came about after answering this query:
 http://gmcnaughton.livejournal.com/27955.html?thread=70451#t70451


- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to