5525 def _reduce(self):
5526 """Reduce this expression by evaluating its static parts.
5527
5528 If the whole expression is static, proceed as normal for an
5529 <apply>. Otherwise check if we have more than one static
5530 operand. If we do, we can combine them in a new static
5531 expression and evaluate that as a whole.
5532 """
5533 app = self.xml_parent
5534 bt = app._get_binding_time()
5535 if bt == BINDING_TIMES.static or not self.model.get_option('partial_pe_commutative'):
5536
5537 app._reduce(check_operator=False)
5538 else:
5539
5540 static_opers = filter(lambda e: app._get_element_binding_time(e) == BINDING_TIMES.static,
5541 app.operands())
5542 if len(static_opers) > 1:
5543
5544 for oper in static_opers:
5545 app.safe_remove_child(oper)
5546
5547 new_expr = mathml_apply.create_new(self, self.localName, static_opers)
5548
5549 app.xml_append(new_expr)
5550 new_expr._reduce()
5551
5552 app._reduce(check_operator=False)
5553