A validator that raises `ValueError` if the initializer is called with a string or iterable that is longer than *length*. Args: length (int): Maximum length of the string or iterable .. versionadded:: 21.3.0
(length)
| 552 | |
| 553 | |
| 554 | def max_len(length): |
| 555 | """ |
| 556 | A validator that raises `ValueError` if the initializer is called |
| 557 | with a string or iterable that is longer than *length*. |
| 558 | |
| 559 | Args: |
| 560 | length (int): Maximum length of the string or iterable |
| 561 | |
| 562 | .. versionadded:: 21.3.0 |
| 563 | """ |
| 564 | return _MaxLengthValidator(length) |
| 565 | |
| 566 | |
| 567 | @attrs(repr=False, frozen=True, slots=True) |