I don’t know who needs to see this, or who—if anyone—will benefit by something so basic. As someone who has a pretty good familiarity with functional programming, often times I find myself wanting to execute a single function such as `print` for each item in an iterable being passed in as an argument one at a time. Now don’t get me wrong, `map` is great, but I’ve gotten so tired of having to wrap it with `list` every time just to bypass the lazy loading. It just feels like too many parenthesis for such an endeavor. I could use a list comprehension of course, but that too comes off as an excessive use of force.
Share this post
Applying a Function to Each Item in a Python…
Share this post
I don’t know who needs to see this, or who—if anyone—will benefit by something so basic. As someone who has a pretty good familiarity with functional programming, often times I find myself wanting to execute a single function such as `print` for each item in an iterable being passed in as an argument one at a time. Now don’t get me wrong, `map` is great, but I’ve gotten so tired of having to wrap it with `list` every time just to bypass the lazy loading. It just feels like too many parenthesis for such an endeavor. I could use a list comprehension of course, but that too comes off as an excessive use of force.