Added mapinto.

This commit is contained in:
Jeremy Fincher 2004-10-12 11:42:03 +00:00
parent 25224a79a1
commit c5903a9591
1 changed files with 4 additions and 0 deletions

View File

@ -821,6 +821,10 @@ def toBool(s):
else:
raise ValueError, 'Invalid string for toBool: %r' % s
def mapinto(f, L):
for (i, x) in enumerate(L):
L[i] = f(x)
if __name__ == '__main__':
import doctest
doctest.testmod(sys.modules['__main__'])