(expr)
return sum(not s.is_integer for s in expr.free_symbols) > 1
Return whether a partial derivative symbol is required for printing

    This requires checking how many free variables there are,
    filtering out the ones that are integers. Some expressions don't have
    free variables. In that case, check its variable list explicitly to
    get the context of the expression.
Return whether a partial derivative symbol is required for printing
Return whether a partial derivative symbol is required for printing
def requires_partial(expr):
    """Return whether a partial derivative symbol is required for printing

    This requires checking how many free variables there are,
    filtering out the ones that are integers. Some expressions don't have
    free variables. In that case, check its variable list explicitly to
    get the context of the expression.
    """

    if not isinstance(expr.free_symbols, collections.Iterable):
        return len(set(expr.variables)) > 1

    return sum(not s.is_integer for s in expr.free_symbols) > 1
def requires_partial ( expr ) : if not isinstance ( expr . free_symbols , collections . Iterable ) : return len ( set ( expr . variables ) ) > 1 return sum ( not s . is_integer for s in expr . free_symbols ) > 1