def __init__(self, ordered_domain, low=None, high=None):
        """
        Parameters:
          - ordered_domain:  an ordered sequence of symbols
          - low: a symbol in the domain that marks the lower bound
          - high: a symbol in the domain that marks the upper bound
        """
        if not isinstance(ordered_domain, list):
            raise CellConstructionFailure("Ordered domain must be a list, with fixed order")
        if len(ordered_domain) != len(set(ordered_domain)):
            # duplicate entries
            raise CellConstructionFailure("All elements of the domain need unique hash")

        self.domain = ordered_domain
        self.low = low
        self.high = high

        # sanity checks
        if low is None:
            self.low = self.domain[0]
        elif low not in self.domain: 
            raise CellConstructionFailure("Value low='%s' not in domain." \
              % (low))
        
        if high is None:
            self.high = self.domain[-1]
        elif high not in self.domain:
            raise CellConstructionFailure("Value high='%s' not in domain." \
                        % (high))

        assert self.domain.index(self.low) <= self.domain.index(self.high), \
                "Lower bound must be <= upper "
def __init__ ( self , ordered_domain , low = None , high = None ) : if not isinstance ( ordered_domain , list ) : raise CellConstructionFailure ( "Ordered domain must be a list, with fixed order" ) if len ( ordered_domain ) != len ( set ( ordered_domain ) ) : raise CellConstructionFailure ( "All elements of the domain need unique hash" ) self . domain = ordered_domain self . low = low self . high = high if low is None : self . low = self . domain [ 0 ] elif low not in self . domain : raise CellConstructionFailure ( "Value low='%s' not in domain." % ( low ) ) if high is None : self . high = self . domain [ - 1 ] elif high not in self . domain : raise CellConstructionFailure ( "Value high='%s' not in domain." % ( high ) ) assert self . domain . index ( self . low ) <= self . domain . index ( self . high ) , "Lower bound must be <= upper "
Parameters:
          - ordered_domain:  an ordered sequence of symbols
          - low: a symbol in the domain that marks the lower bound
          - high: a symbol in the domain that marks the upper bound