(self, b)
return prettyForm(binding=prettyForm.POW, *bot.above(top))
Make a pretty power.
Make a pretty power.
Make a pretty power .
def __pow__(self, b):
        """Make a pretty power.
        """
        a = self
        if a.binding > prettyForm.FUNC:
            a = stringPict(*a.parens())
        if b.binding == prettyForm.POW:
            b = stringPict(*b.parens())

        if a.binding == prettyForm.FUNC:
            #         2
            #  sin  +   + (x)
            b.baseline = a.prettyFunc.baseline + 1
            func = stringPict(*a.prettyFunc.right(b))
            return prettyForm(*func.right(a.prettyArgs))
        else:
            #      2    <-- top
            # (x+y)     <-- bot
            top = stringPict(*b.left(' '*a.width()))
            bot = stringPict(*a.right(' '*b.width()))

        return prettyForm(binding=prettyForm.POW, *bot.above(top))
def __pow__ ( self , b ) : a = self if a . binding > prettyForm . FUNC : a = stringPict ( * a . parens ( ) ) if b . binding == prettyForm . POW : b = stringPict ( * b . parens ( ) ) if a . binding == prettyForm . FUNC : #         2 #  sin  +   + (x) b . baseline = a . prettyFunc . baseline + 1 func = stringPict ( * a . prettyFunc . right ( b ) ) return prettyForm ( * func . right ( a . prettyArgs ) ) else : #      2    <-- top # (x+y)     <-- bot top = stringPict ( * b . left ( ' ' * a . width ( ) ) ) bot = stringPict ( * a . right ( ' ' * b . width ( ) ) ) return prettyForm ( binding = prettyForm . POW , * bot . above ( top ) )