| |
comp.lang.python |
mosscliffe schreef: > def fillwith(fillchars): > for x,y in map(fillwith("N/A"), lista, listb): ########## Fails also - map(None, lista, listb) is equivalent to: def maketuple(a, b): So what you want to do can be done with map like this: def make_fill_missing(fillchars): map(make_fill_missing("N/A"), lista, listb)) -- Roel Schroeven
> 'str'
> print "MAP:", x, "<<x y>>", y
> return fillchars
> Can not call a 'str'
> print "MAP:", x, "<<x y>>", y
of the argument sequences. If the first argument is None, a default
function is used which returns a tuple of the items. In the case that
two input sequences are provided:
return a, b
map(maketuple, lista, listb)
def fill_missing(a, b):
if a is None:
a = fillchars
if b is None:
b = fillchars
return a, b
return fill_missing
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton