pyiron_base.utils.instance.static_isinstance

pyiron_base.utils.instance.static_isinstance#

pyiron_base.utils.instance.static_isinstance(obj: object, obj_type: str | List[str]) bool[source]#

A static implementation of isinstance() - instead of comparing an object and a class, the object is compared to a string, like ‘pyiron_base.jobs.job.generic.GenericJob’ or a list of strings.

Parameters:
  • obj (object) – The object to check.

  • obj_type (str/list) – Object type as string or a list of object types as string.

Returns:

True if the object is an instance of any of the specified types, False otherwise.

Return type:

bool