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

Function annotations_to_string

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

1091
1092
1093def annotations_to_string(annotations):
1094 """Convert an annotation dict containing values to approximately the STRING format.
1095
1096 Always returns a fresh a dictionary.
1097 """
1098 return {
1099 n: t if isinstance(t, str) else type_repr(t)
1100 for n, t in annotations.items()
1101 }
1102
1103
1104def _rewrite_star_unpack(arg):

Callers 3

call_annotate_functionFunction · 0.85
get_annotationsFunction · 0.85

Calls 3

isinstanceFunction · 0.85
type_reprFunction · 0.85
itemsMethod · 0.45

Tested by 1