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

Function le

src/attr/validators.py:493–505  ·  view source on GitHub ↗

A validator that raises `ValueError` if the initializer is called with a number greater than *val*. The validator uses `operator.le` to compare the values. Args: val: Inclusive upper bound for values. .. versionadded:: 21.3.0

(val)

Source from the content-addressed store, hash-verified

491
492
493def le(val):
494 """
495 A validator that raises `ValueError` if the initializer is called with a
496 number greater than *val*.
497
498 The validator uses `operator.le` to compare the values.
499
500 Args:
501 val: Inclusive upper bound for values.
502
503 .. versionadded:: 21.3.0
504 """
505 return _NumberValidator(val, "<=", operator.le)
506
507
508def ge(val):

Callers

nothing calls this directly

Calls 1

_NumberValidatorClass · 0.85

Tested by

no test coverage detected