pyvista.core._validation.check.check_contains#
- check_contains(*, item, container, name='Input')[source]#
Check if an item is in a container.
- Parameters:
- item
Any
Item to check.
- container
Any
Container the item is expected to be in.
- name
str
, default: “Input” Variable name to use in the error messages if any are raised.
- item
- Raises:
ValueError
If the string is not in the iterable.
See also
Examples
Check if
"A"
is in a list of strings.>>> from pyvista import _validation >>> _validation.check_contains(item="A", container=["A", "B", "C"])