MCPcopy Create free account
hub / github.com/dropbox/pyannotate / assert_dict_item

Function assert_dict_item

pyannotate_tools/annotations/parse.py:110–115  ·  view source on GitHub ↗
(dictionary, key, typ)

Source from the content-addressed store, hash-verified

108 assert isinstance(value, typ), '%s: Unexpected type %r' % (path, type(value).__name__)
109
110 def assert_dict_item(dictionary, key, typ):
111 # type: (Mapping[Any, Any], str, type) -> None
112 assert key in dictionary, '%s: Missing dictionary key %r' % (path, key)
113 value = dictionary[key]
114 assert isinstance(value, typ), '%s: Unexpected type %r for key %r' % (
115 path, type(value).__name__, key)
116
117 assert_type(data, list)
118 for item in data:

Callers 1

parse_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected