Python 3 map returns a generator. But I want to apply my function immediately without going through generator. My code is:
printme = lambda x: print(x)
list(map(printme, fields))
for _ in map(printme, fields): pass
Why I have to build list or dive into loop? Why I can't just write map(printme, fields)? This idiom was working well for Python 2. What I have missed? Or how I can achieve this goal another way?