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

Method set

Lib/tomllib/_parser.py:237–246  ·  view source on GitHub ↗
(self, key: Key, flag: int, *, recursive: bool)

Source from the content-addressed store, hash-verified

235 cont.pop(key[-1], None)
236
237 def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003
238 cont = self._flags
239 key_parent, key_stem = key[:-1], key[-1]
240 for k in key_parent:
241 if k not in cont:
242 cont[k] = {"flags": set(), "recursive_flags": set(), "nested": {}}
243 cont = cont[k]["nested"]
244 if key_stem not in cont:
245 cont[key_stem] = {"flags": set(), "recursive_flags": set(), "nested": {}}
246 cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag)
247
248 def is_(self, key: Key, flag: int) -> bool:
249 if not key:

Callers 5

finalize_pendingMethod · 0.95
parse_inline_tableFunction · 0.95
create_dict_ruleFunction · 0.45
create_list_ruleFunction · 0.45
key_value_ruleFunction · 0.45

Calls 2

setFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected