Does anyone know how to translate this HOF from previous version of Python to Python 3?
apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns))
This comes from the book titled: Text Processing in Python by David Mertz. I'm not able to use the apply function in Python 3 since it has been deprecated. I've tried using func(*args, **kwargs) instead of apply(func, args, kwargs), but I get this TypeError: 'float' object is not iterable. I've also found those notes which show what the function is supposed to return: https://wiki.python.org/moin/TextProcessingInPython
here's my try at the code:
apply_each = lambda fns, args=[]: map(fns, *args)
args = [5.4, 6.3, 6.3]
print(list(apply_each(approx, args)))