pyvista_validation.check.check_contains#
- pyvista_validation.check.check_contains(container, /, must_contain, *, name='Input')#
Check if an item is in a container.
- Parameters:
- containerAny
Container to check.
- must_containAny
Item which must be in the container.
- namestr, default: “Input”
Variable name to use in the error messages if any are raised.
- Returns:
- object
must_contain, unchanged.
- Raises:
- ValueError
If the item is not in the container.
See also
Examples
Check if
"A"is in a list of strings.>>> from pyvista_validation import check_contains >>> check_contains(['A', 'B', 'C'], must_contain='A') 'A'