annotation_issubclass
Test if a given annotation is of the given subclass.
def annotation_issubclass(
annotation: typing.Any,
cls: type
) - > bool
Test if a given annotation is of the given subclass.
Parameters
| Name | Type | Description |
|---|---|---|
| annotation | typing.Any | The type hint or annotation object to evaluate |
| cls | type | The class type against which the annotation is checked for a subclass relationship |
Returns
| Type | Description |
|---|---|
bool | True if the annotation is a valid class and is a subclass of the specified type, otherwise False |