src.FRAME_FM.utils.transform_utils
Functions
|
Check if the object is an instance of the allowed types, and raise a TypeError if not. |
Module Contents
- src.FRAME_FM.utils.transform_utils.check_object_type(obj: object, allowed_types: object | tuple[object, Ellipsis], caller: str) object[source]
Check if the object is an instance of the allowed types, and raise a TypeError if not.
- Parameters:
obj (-) – The object to check.
allowed_types (-) – The type or types that the object is allowed to be.
caller (-) – The name of the calling function or transform, used for error messages.
- Returns:
The original object if it is of an allowed type.
- Return type:
object
- Raises:
- TypeError – If the object is not an instance of any of the allowed types.