pyvista.core._validation.check.check_contains

pyvista.core._validation.check.check_contains#

check_contains(
container: Container[Any],
/,
must_contain: Any,
*,
name: str = 'Input',
) None[ソース]#

Check if an item is in a container.

パラメータ:
containerAny

Container to check.

must_containAny

Item which must be in the container.

namestr, default: "Input"

エラーメッセージが発生した場合に使用する変数名.

エラー処理:
ValueError

If the item is not in the container.

"A"` が文字列のリストの中にあるかどうかをチェックします.

>>> from pyvista import _validation
>>> _validation.check_contains(['A', 'B', 'C'], must_contain='A')