(obj: object, name: str, ann: str)
| 79 | |
| 80 | |
| 81 | def annotated_getattr(obj: object, name: str, ann: str) -> object: |
| 82 | try: |
| 83 | obj = getattr(obj, name) |
| 84 | except AttributeError as e: |
| 85 | raise AttributeError( |
| 86 | "{!r} object at {} has no attribute {!r}".format( |
| 87 | type(obj).__name__, ann, name |
| 88 | ) |
| 89 | ) from e |
| 90 | return obj |
| 91 | |
| 92 | |
| 93 | def derive_importpath(import_path: str, raising: bool) -> Tuple[str, object]: |
no test coverage detected