is_matching_type(_type: Type, annotation: Any) → bool¶
Return whether a specified type matches an annotation.
This function does a bit more than a simple comparison, and performs the following extra checks:
annotationis a union, then the union is unwrapped and each of its types is compared against
If the specified
_typeis generic, it will verify that all of its parameters match those of a matching annotation.