Jan-21-2022, 11:12 AM
What I've understood thus far is that this wouldn't/shouldn't work:
The reason why I thought it was behaving differently was that I didn't actually test it correctly. Applying str on a list works, but applying anything else doesn't. And I was trying to test it by changing str to int (for a date format), and it didn't work and I thought this was expected behaviour, but I hadn't properly test int/float which wouldn't have worked either way.
row = [ func(row) for func in types ]I am applying the function (str) to the entire list and it doesn't make sense. Whereas iterating over the list should work.
The reason why I thought it was behaving differently was that I didn't actually test it correctly. Applying str on a list works, but applying anything else doesn't. And I was trying to test it by changing str to int (for a date format), and it didn't work and I thought this was expected behaviour, but I hadn't properly test int/float which wouldn't have worked either way.