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

Function annotations_to_string

Lib/annotationlib.py:1106–1114  ·  view source on GitHub ↗

Convert an annotation dict containing values to approximately the STRING format. Always returns a fresh a dictionary.

(annotations)

Source from the content-addressed store, hash-verified

1104
1105
1106def annotations_to_string(annotations):
1107 """Convert an annotation dict containing values to approximately the STRING format.
1108
1109 Always returns a fresh a dictionary.
1110 """
1111 return {
1112 n: t if isinstance(t, str) else type_repr(t)
1113 for n, t in annotations.items()
1114 }
1115
1116
1117def _rewrite_star_unpack(arg):

Callers 3

call_annotate_functionFunction · 0.85
get_annotationsFunction · 0.85

Calls 2

type_reprFunction · 0.85
itemsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…