baybe.utils.boolean.is_abstract

baybe.utils.boolean.is_abstract(cls: Any)[source]

Determine if a given class is abstract.

This check is more general sense than inspect.abstract, which only verifies if a class has abstract methods. The latter can be problematic when the class has no abstract methods but is nevertheless not directly usable, for example, because it has uninitialized members, which are only covered in its non-“abstract” subclasses. By contrast, this method simply checks if the class derives from abc.ABC.

Parameters:

cls (Any) – The class to be inspected.

Return type:

bool

Returns:

True if the class is “abstract” (see definition above), False else.