def withSize(cls, minimum, maximum):
        """Creates a subclass with value size constraint.
        """

        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.ValueSizeConstraint(
                minimum, maximum)

        X.__name__ = cls.__name__
        return X