(self, part)
return False
Decrements part (a subrange of pstack), if possible, returning
        True iff the part was successfully decremented.

        If you think of the v values in the part as a multi-digit
        integer (least significant digit on the right) this is
        basically decrementing that integer, but with the extra
        constraint that the leftmost digit cannot be decremented to 0.

        Parameters
        ==========

        part
           The part, represented as a list of PartComponent objects,
           which is to be decremented.
Decrements part (a subrange of pstack), if possible, returning
        True iff the part was successfully decremented.
Decrements part ( a subrange of pstack ) if possible returning True iff the part was successfully decremented .
def decrement_part(self, part):
        """Decrements part (a subrange of pstack), if possible, returning
        True iff the part was successfully decremented.

        If you think of the v values in the part as a multi-digit
        integer (least significant digit on the right) this is
        basically decrementing that integer, but with the extra
        constraint that the leftmost digit cannot be decremented to 0.

        Parameters
        ==========

        part
           The part, represented as a list of PartComponent objects,
           which is to be decremented.

        """
        plen = len(part)
        for j in xrange(plen - 1, -1, -1):
            if (j == 0 and part[j].v > 1) or (j > 0 and part[j].v > 0):
                # found val to decrement
                part[j].v -= 1
                # Reset trailing parts back to maximum
                for k in xrange(j + 1, plen):
                    part[k].v = part[k].u
                return True
        return False
def decrement_part ( self , part ) : plen = len ( part ) for j in xrange ( plen - 1 , - 1 , - 1 ) : if ( j == 0 and part [ j ] . v > 1 ) or ( j > 0 and part [ j ] . v > 0 ) : # found val to decrement part [ j ] . v -= 1 # Reset trailing parts back to maximum for k in xrange ( j + 1 , plen ) : part [ k ] . v = part [ k ] . u return True return False