MCPcopy Index your code
hub / github.com/python/cpython / _get_and_call_annotate

Function _get_and_call_annotate

Lib/annotationlib.py:1127–1138  ·  view source on GitHub ↗

Get the __annotate__ function and call it. May not return a fresh dictionary.

(obj, format)

Source from the content-addressed store, hash-verified

1125
1126
1127def _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__

Callers 1

get_annotationsFunction · 0.85

Calls 1

call_annotate_functionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…