Python pyasn1.type.constraint.ValueSizeConstraint() Examples

The following are 1 code examples of pyasn1.type.constraint.ValueSizeConstraint(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyasn1.type.constraint , or try the search function .
Example #1
Source File: rfc1902.py    From scalyr-agent-2 with Apache License 2.0 5 votes vote down vote up
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