Re: can list comprehensions replace map?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: can list comprehensions replace map?

From: Michael Hoffman <cam.ac.uk@mh391.invalid>
Date: Wed Jul 27 2005 - 20:39:59 CEST

David Isaac wrote:
> Newbie question:
>
> I have been generally open to the proposal that list comprehensions
> should replace 'map', but I ran into a need for something like
> map(None,x,y)
> when len(x)>len(y). I cannot it seems use 'zip' because I'll lose
> info from x. How do I do this as a list comprehension? (Or,
> more generally, what is the best way to do this without 'map'?)

It ain't broke so I'd stick with what you're doing. Even if map() is
removed as a builtin, it will surely stick around in a module.

-- 
Michael Hoffman
Received on Thu Sep 29 17:11:49 2005