Python源码示例:pyasn1.type.constraint.ValueSizeConstraint()

示例1
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