return True if the given type has an __origin__ that shares a base with the given class
(
type_: Any, class_obj: Union[Tuple[Type[Any], ...], Type[Any]]
)
| 583 | |
| 584 | |
| 585 | def is_origin_of_cls( |
| 586 | type_: Any, class_obj: Union[Tuple[Type[Any], ...], Type[Any]] |
| 587 | ) -> bool: |
| 588 | """return True if the given type has an __origin__ that shares a base |
| 589 | with the given class""" |
| 590 | |
| 591 | origin = get_origin(type_) |
| 592 | if origin is None: |
| 593 | return False |
| 594 | |
| 595 | return isinstance(origin, type) and issubclass(origin, class_obj) |
| 596 | |
| 597 | |
| 598 | def is_origin_of( |
no outgoing calls
no test coverage detected