lenient_issubclass
Checks if an object is a class and a subclass of a given type or tuple of types, avoiding errors if the first argument is not a class.
def lenient_issubclass(
cls: Any,
class_or_tuple: AnyType | tuple[AnyType, ...]
) - > bool
Checks if a class is a subclass of another class or tuple of classes without raising a TypeError if the first argument is not a type.
Parameters
| Name | Type | Description |
|---|---|---|
| cls | Any | The object to check for subclass status. |
| class_or_tuple | `AnyType | tuple[AnyType, ...]` |
Returns
| Type | Description |
|---|---|
bool | True if the first argument is a class and is a subclass of the second argument, otherwise False. |