(expr, hint, deep=True, **hints)
return (expr, hit)
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.
Helper for ``expand()``.  Recursively calls ``expr._eval_expand_hint()``.
Helper for expand () . Recursively calls expr . _eval_expand_hint () .
def _expand_hint(expr, hint, deep=True, **hints):
        """
        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.
        """
        hit = False
        # XXX: Hack to support non-Basic args
        #              |
        #              V
        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)
def _expand_hint ( expr , hint , deep = True , * * hints ) : hit = False # XXX: Hack to support non-Basic args #              | #              V 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 )