Get the __annotate__ function and call it. May not return a fresh dictionary.
(obj, format)
| 1125 | |
| 1126 | |
| 1127 | def _get_and_call_annotate(obj, format): |
| 1128 | """Get the __annotate__ function and call it. |
| 1129 | |
| 1130 | May not return a fresh dictionary. |
| 1131 | """ |
| 1132 | annotate = getattr(obj, "__annotate__", None) |
| 1133 | if annotate is not None: |
| 1134 | ann = call_annotate_function(annotate, format, owner=obj) |
| 1135 | if not isinstance(ann, dict): |
| 1136 | raise ValueError(f"{obj!r}.__annotate__ returned a non-dict") |
| 1137 | return ann |
| 1138 | return None |
| 1139 | |
| 1140 | |
| 1141 | _BASE_GET_ANNOTATIONS = type.__dict__["__annotations__"].__get__ |
no test coverage detected
searching dependent graphs…