'Helper for ``expand()``.  Recursively calls ``expr._eval_expand_hint()``.
Returns ``(expr, hit)``, where expr is the (possibly) expanded
``expr`` and ``hit`` is ``True`` if ``expr`` was truly expanded and
``False`` otherwise.'

@staticmethod
def _expand_hint(expr, hint, deep=True, **hints):

    hit = False
    if (deep and getattr(expr, 'args', ()) and (not expr.is_Atom)):
        sargs = []
        for arg in expr.args:
            (arg, arghit) = Expr._expand_hint(arg, hint, **hints)
            hit |= arghit
            sargs.append(arg)
        if hit:
            expr = expr.func(*sargs)
    if hasattr(expr, hint):
        newexpr = getattr(expr, hint)(**hints)
        if (newexpr != expr):
            return (newexpr, True)
    return (expr, hit)
