2 ms·
I think the problem is more that Python doesn't really have the idea of predicates as an abstraction. It's not that it doesn't have predicates, it's just that t
by brudgers 9y ago
I think the problem is more that Python doesn't really have the idea of predicates as an abstraction. It's not that it doesn't have predicates, it's just that they are not called that and not seen as thing in their own right and not something that programmers are encouraged to write.
- cup-of-tea 9y agoYeah, that's true. Maybe I'm being narrow minded and not "Pythonic" enough, but I always end up writing predicates. I can see that non-trivial predicate functions could be changed to non-trivial functions that return something which can later be compared to get the boolean. But what about having a list of of predicates and wanting to test them all at once. all(p(x) for p in predicates) seems perfect for this...