this post was submitted on 22 Nov 2023
295 points (100.0% liked)
196
16442 readers
2620 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Python's disdain for the industry standard is wild. Every other language made in the last 20 years has proper filtering that doesn't require collecting the results back into a list after filtering like Java (granted it's even more verbose in Java but that's a low bar).
If Python had modern lambdas and filter was written in an inclusion or parametric polymorphic way, then you could write:
Many languages have shorthands to refer to variables too, so it wouldn't be impossible to see:
Of course in actual Python you'd instead see:
which is arguably worse than