View Single Post
Old Jun 9th, 2006, 11:36 PM   #23
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Smile

Just to warn you, both filter() and map() will go away with Python3. As Arevos pointed out, they can be easily replaced with list comprehensions:
# write your own using list comprehension:
def map(f, s):
    return [f(x) for x in s]

def filter(f, s):
    return [x for x in s if f(s)]
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote