> def _areConstants(expressions):That's not an improvement but also not the obvious way to rewrite the
> for expression in expressions:
> if not expression.isExpressionConstantRef():
> break
> if expression.isMutable():
> break
> else:
> return True
> return False
code to suppress the, IMHO legitimate, warning. Instead of introducing
``break``\s for an unnecessary ``else`` clause one could also just
remove that unnecessary ``else``::
def _areConstants(expressions):return True
for expression in expressions:
if not expression.isExpressionConstantRef():
return False
if expression.isMutable():
return False
Which improves the situation in a way, because now the fellow Python
coder doesn't wonder where the ``break`` should be or if the author
understood the semantics of ``else`` on loop constructs.
I would also avoid this question by using `all()` here. :-)