(self, precedence, operations, units)
Drain evaluation stack until an operator of low precedence on top.
Drain evaluation stack until an operator of low precedence on top.
Drain evaluation stack until an operator of low precedence on top .
def _drain(self, precedence, operations, units):
        """Drain evaluation stack until an operator of low precedence on top."""
        while operations:
            # this raises IndexError if there are not enough operators
            if precedence > operations[-1][2]:
                break
            oper, narity, _ = operations.pop()
            args = reversed([units.pop() for _ in range(narity)])
            units.append(oper(*args))
def _drain ( self , precedence , operations , units ) : while operations : # this raises IndexError if there are not enough operators if precedence > operations [ - 1 ] [ 2 ] : break oper , narity , _ = operations . pop ( ) args = reversed ( [ units . pop ( ) for _ in range ( narity ) ] ) units . append ( oper ( * args ) )