(
class_or_mapper: Union[Mapper[_T], Type[_T]],
)
| 437 | |
| 438 | |
| 439 | def _class_to_mapper( |
| 440 | class_or_mapper: Union[Mapper[_T], Type[_T]], |
| 441 | ) -> Mapper[_T]: |
| 442 | # can't get mypy to see an overload for this |
| 443 | insp = inspection.inspect(class_or_mapper, False) |
| 444 | if insp is not None: |
| 445 | return insp.mapper # type: ignore |
| 446 | else: |
| 447 | assert isinstance(class_or_mapper, type) |
| 448 | raise exc.UnmappedClassError(class_or_mapper) |
| 449 | |
| 450 | |
| 451 | def _mapper_or_none( |
no outgoing calls
no test coverage detected