MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_and_call_annotate

Function _get_and_call_annotate

Lib/annotationlib.py:1114–1125  ·  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

1112
1113
1114def _get_and_call_annotate(obj, format):
1115 """Get the __annotate__ function and call it.
1116
1117 May not return a fresh dictionary.
1118 """
1119 annotate = getattr(obj, "__annotate__", None)
1120 if annotate is not None:
1121 ann = call_annotate_function(annotate, format, owner=obj)
1122 if not isinstance(ann, dict):
1123 raise ValueError(f"{obj!r}.__annotate__ returned a non-dict")
1124 return ann
1125 return None
1126
1127
1128_BASE_GET_ANNOTATIONS = type.__dict__["__annotations__"].__get__

Callers 1

get_annotationsFunction · 0.85

Calls 3

getattrFunction · 0.85
call_annotate_functionFunction · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected