MCPcopy
hub / github.com/python-attrs/attrs / min_len

Function min_len

src/attr/validators.py:583–593  ·  view source on GitHub ↗

A validator that raises `ValueError` if the initializer is called with a string or iterable that is shorter than *length*. Args: length (int): Minimum length of the string or iterable .. versionadded:: 22.1.0

(length)

Source from the content-addressed store, hash-verified

581
582
583def min_len(length):
584 """
585 A validator that raises `ValueError` if the initializer is called
586 with a string or iterable that is shorter than *length*.
587
588 Args:
589 length (int): Minimum length of the string or iterable
590
591 .. versionadded:: 22.1.0
592 """
593 return _MinLengthValidator(length)
594
595
596@attrs(repr=False, slots=True, unsafe_hash=True)

Callers 4

TesterClass · 0.90
test_reprMethod · 0.90

Calls 1

_MinLengthValidatorClass · 0.85

Tested by 3

test_reprMethod · 0.72