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

Function _make_eager_annotate

Lib/typing.py:2941–2952  ·  view source on GitHub ↗
(types)

Source from the content-addressed store, hash-verified

2939
2940
2941def _make_eager_annotate(types):
2942 checked_types = {key: _type_check(val, f"field {key} annotation must be a type")
2943 for key, val in types.items()}
2944 def annotate(format):
2945 match format:
2946 case _lazy_annotationlib.Format.VALUE | _lazy_annotationlib.Format.FORWARDREF:
2947 return checked_types
2948 case _lazy_annotationlib.Format.STRING:
2949 return _lazy_annotationlib.annotations_to_string(types)
2950 case _:
2951 raise NotImplementedError(format)
2952 return annotate
2953
2954
2955# attributes prohibited to set in NamedTuple class syntax

Callers 2

__new__Method · 0.85
NamedTupleFunction · 0.85

Calls 2

_type_checkFunction · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected