(self, prefix)
| 1227 | self._parent = parent |
| 1228 | |
| 1229 | def child(self, prefix): |
| 1230 | if prefix not in self._children: |
| 1231 | new_child = NameScope(prefix, self) |
| 1232 | self._children[prefix] = [new_child] |
| 1233 | else: |
| 1234 | new_child = NameScope( |
| 1235 | f"{prefix}_{len(self._children[prefix])}", self |
| 1236 | ) |
| 1237 | self._children[prefix].append(new_child) |
| 1238 | return new_child |
| 1239 | |
| 1240 | def parent(self): |
| 1241 | return self._parent |
no test coverage detected