(self, key: Key, flag: int)
| 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: |
| 249 | return False # document root has no flags |
| 250 | cont = self._flags |
| 251 | for k in key[:-1]: |
| 252 | if k not in cont: |
| 253 | return False |
| 254 | inner_cont = cont[k] |
| 255 | if flag in inner_cont["recursive_flags"]: |
| 256 | return True |
| 257 | cont = inner_cont["nested"] |
| 258 | key_stem = key[-1] |
| 259 | if key_stem in cont: |
| 260 | cont = cont[key_stem] |
| 261 | return flag in cont["flags"] or flag in cont["recursive_flags"] |
| 262 | return False |
| 263 | |
| 264 | |
| 265 | class NestedDict: |
no outgoing calls