[Python-Dev] Patches
Paul Prescod
paul@prescod.net
Tue, 18 Jul 2000 20:45:24 -0500
Skip Montanaro wrote:
>
> ...
> newlist = map(string.strip, oldlist)
>
> As far as I'm aware, there's no clean way to do that with string methods.
Once we have list comprehensions, there will be:
newlist = [for x in oldlist: x.strip()]
I think the list-comp version is much more readable and "generic".
--
Paul Prescod - Not encumbered by corporate consensus
Just how compassionate can a Republican get before he has to leave the
GOP and join Vegans for Global Justice? ... One moment, George W. Bush
is holding a get-to-know-you meeting with a bunch of gay Republicans.
The next he is holding forth on education or the environment ... It is
enough to make a red-blooded conservative choke on his spotted-owl
drumstick. - April 29th, Economist