3 ms·
I would agree that using list comprehensions over iterating is idiomatic Python, but I would not say that the task of applying a function to a list is an idiom
by c3534l 7y ago
I would agree that using list comprehensions over iterating is idiomatic Python, but I would not say that the task of applying a function to a list is an idiom like how the website seems to indicate. There may or may not be an idiomatic way in a given language, it's really dependant on the language which is why you can't map tasks to idioms. C# has Python list comprehensions, but it's not the preferred way to do things and so I wouldn't call it a programming idiom. I'm not trying to argue that programming idioms are the exact same thing as idiomatic expressions, I was trying to explain what programming idioms are by appealing to the sense in which the term was coined.