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

Method set

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

Source from the content-addressed store, hash-verified

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