by _asummers · 10y ago · 0 comments
for rule in self.rules:
if not rule.canPost:
return False
return True
That's the same number of lines of code, doesn't require two imports, and is way easier to follow. I love functional programming but Python (intentionally, see reduce in py3) is not a language for doing it. return all(rule.canPost for rule in self.rules)