code: def withValues(cls, *values):
          
  
          class X(cls):
              subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint(
                  *values)
  
          X.__name__ = cls.__name__
          return X
docs: Creates a subclass with discreet values constraint.