code: def withNamedValues(cls, **values):
          
          enums = set(cls.namedValues.items())
          enums.update(values.items())
  
          class X(cls):
              namedValues = namedval.NamedValues(*enums)
              subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint(
                  *values.values())
  
          X.__name__ = cls.__name__
  
          return X
docs: Create a subclass with discreet named values constraint.
  
          Reduce fully duplicate enumerations along the way.