(self, key: Key, flag: int)
| 173 | cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag) |
| 174 | |
| 175 | def is_(self, key: Key, flag: int) -> bool: |
| 176 | if not key: |
| 177 | return False # document root has no flags |
| 178 | cont = self._flags |
| 179 | for k in key[:-1]: |
| 180 | if k not in cont: |
| 181 | return False |
| 182 | inner_cont = cont[k] |
| 183 | if flag in inner_cont["recursive_flags"]: |
| 184 | return True |
| 185 | cont = inner_cont["nested"] |
| 186 | key_stem = key[-1] |
| 187 | if key_stem in cont: |
| 188 | cont = cont[key_stem] |
| 189 | return flag in cont["flags"] or flag in cont["recursive_flags"] |
| 190 | return False |
| 191 | |
| 192 | |
| 193 | class NestedDict: |
no outgoing calls
no test coverage detected