'Returns True if the expression needs to be wrapped in brackets when
printed, False otherwise. For example: a + b => True; a => False;
10 => False; -10 => True.'

def _needs_brackets(self, expr):

    return (not ((expr.is_Integer and expr.is_nonnegative) or (expr.is_Atom and ((expr is not S.NegativeOne) and (expr.is_Rational is False)))))
