(self, expr, last=False)
return expr.is_Add or (not last and
            any([expr.has(x) for x in (Integral, Piecewise, Product, Sum)]))
Returns True if the expression needs to be wrapped in brackets when
        printed as part of a Mul, False otherwise. This is True for Add,
        but also for some container objects that would not need brackets
        when appearing last in a Mul, e.g. an Integral. ``last=True``
        specifies that this expr is the last to appear in a Mul.
Returns True if the expression needs to be wrapped in brackets when
        printed as part of a Mul, False otherwise. This is True for Add,
        but also for some container objects that would not need brackets
        when appearing last in a Mul, e.g. an Integral. ``last=True``
        specifies that this expr is the last to appear in a Mul.
Returns True if the expression needs to be wrapped in brackets when printed as part of a Mul False otherwise . This is True for Add but also for some container objects that would not need brackets when appearing last in a Mul e . g . an Integral . last = True specifies that this expr is the last to appear in a Mul .
def _needs_mul_brackets(self, expr, last=False):
        """
        Returns True if the expression needs to be wrapped in brackets when
        printed as part of a Mul, False otherwise. This is True for Add,
        but also for some container objects that would not need brackets
        when appearing last in a Mul, e.g. an Integral. ``last=True``
        specifies that this expr is the last to appear in a Mul.
        """
        from sympy import Integral, Piecewise, Product, Sum
        return expr.is_Add or (not last and
            any([expr.has(x) for x in (Integral, Piecewise, Product, Sum)]))
def _needs_mul_brackets ( self , expr , last = False ) : from sympy import Integral , Piecewise , Product , Sum return expr . is_Add or ( not last and any ( [ expr . has ( x ) for x in ( Integral , Piecewise , Product , Sum ) ] ) )