2 ms·
so does Scala stuff.filter(_ % 2 == 0).map(_ / 2) and C#, demonstrating that this isn't some obscure feature that only language geeks care about: Stu
by lihaoyi 14y ago
so does Scala
stuff.filter(_ % 2 == 0).map(_ / 2)
and C#, demonstrating that this isn't some obscure feature that only language geeks care about:
Stuff.Where(x => x % 2 == 0).Select(x => x / 2)
My point isn't that this sort of syntax is new and novel, it's just that in Python it's annoyingly inconsistent. There are reasons where you would want to use type-class style modules to structure your code in a certain way, but I do not think python's map() filter() reduce() and len() qualify as these cases