3 ms·
If all you are doing is trying a bunch of cases (or filters) on some data, why not just use all and a list comprehension on functions. all([postAllowFilter() f
by gravypod 11y ago
If all you are doing is trying a bunch of cases (or filters) on some data, why not just use all and a list comprehension on functions.
all([postAllowFilter() for postAllowFilter in filters])
Then just take a list of all of your functions.
Really, there just should have been a restructuring of the initial code flow. It didn't look too messy.