MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / in_

Function in_

src/licensedcode/_vendor/attr/validators.py:318–333  ·  view source on GitHub ↗

A validator that raises a `ValueError` if the initializer is called with a value that does not belong in the options provided. The check is performed using ``value in options``. :param options: Allowed options. :type options: list, tuple, `enum.Enum`, ... :raises ValueErr

(options)

Source from the content-addressed store, hash-verified

316
317
318def in_(options):
319 """
320 A validator that raises a `ValueError` if the initializer is called
321 with a value that does not belong in the options provided. The check is
322 performed using ``value in options``.
323
324 :param options: Allowed options.
325 :type options: list, tuple, `enum.Enum`, ...
326
327 :raises ValueError: With a human readable error message, the attribute (of
328 type `attrs.Attribute`), the expected options, and the value it
329 got.
330
331 .. versionadded:: 17.1.0
332 """
333 return _InValidator(options)
334
335
336@attrs(repr=False, slots=False, hash=True)

Callers

nothing calls this directly

Calls 1

_InValidatorClass · 0.85

Tested by

no test coverage detected