pyvista.core._validation.check.check_type#
- check_type(obj, /, classinfo, *, name='Object')[source]#
Check if an object is one of the given type or types.
- Parameters:
- Raises:
TypeError
If object is not any of the given types.
See also
Notes
The use of
check_instance()
is generally preferred as it allows subclasses. Usecheck_type()
only for cases where exact types are necessary.Examples
Check if an object is type
dict
orset
.>>> from pyvista import _validation >>> _validation.check_type({'spam': "eggs"}, (dict, set))