(import_path: str, raising: bool)
| 101 | |
| 102 | |
| 103 | def derive_importpath(import_path: str, raising: bool) -> tuple[str, object]: |
| 104 | if not isinstance(import_path, str) or "." not in import_path: |
| 105 | raise TypeError(f"must be absolute import path string, not {import_path!r}") |
| 106 | module, attr = import_path.rsplit(".", 1) |
| 107 | target = resolve(module) |
| 108 | if raising: |
| 109 | annotated_getattr(target, attr, ann=module) |
| 110 | return attr, target |
| 111 | |
| 112 | |
| 113 | @final |
no test coverage detected