pyvista.core._validation.check.check_iterable#

check_iterable(obj, /, *, name='Object')[source]#

Check if an object is an instance of Iterable.

Parameters:
objIterable

Iterable object to check.

namestr, default: “Object”

Variable name to use in the error messages if any are raised.

Raises:
TypeError

If input is not an instance of Iterable.

Examples

Check if an object is iterable.

>>> import numpy as np
>>> from pyvista import _validation
>>> _validation.check_iterable([1, 2, 3])
>>> _validation.check_iterable(np.array((4, 5, 6)))