Initializer. Takes a type constant (a symbol number >= 256), a sequence of child nodes, and an optional context keyword argument. As a side effect, the parent pointers of the children are updated.
(
self,
type: int,
children: list[NL],
context: Any | None = None,
prefix: str | None = None,
fixers_applied: list[Any] | None = None,
)
| 235 | used_names: set[str] | None |
| 236 | |
| 237 | def __init__( |
| 238 | self, |
| 239 | type: int, |
| 240 | children: list[NL], |
| 241 | context: Any | None = None, |
| 242 | prefix: str | None = None, |
| 243 | fixers_applied: list[Any] | None = None, |
| 244 | ) -> None: |
| 245 | """ |
| 246 | Initializer. |
| 247 | |
| 248 | Takes a type constant (a symbol number >= 256), a sequence of |
| 249 | child nodes, and an optional context keyword argument. |
| 250 | |
| 251 | As a side effect, the parent pointers of the children are updated. |
| 252 | """ |
| 253 | assert type >= 256, type |
| 254 | self.type = type |
| 255 | self.children = list(children) |
| 256 | for ch in self.children: |
| 257 | assert ch.parent is None, repr(ch) |
| 258 | ch.parent = self |
| 259 | self.invalidate_sibling_maps() |
| 260 | if prefix is not None: |
| 261 | self.prefix = prefix |
| 262 | if fixers_applied: |
| 263 | self.fixers_applied = fixers_applied[:] |
| 264 | else: |
| 265 | self.fixers_applied = None |
| 266 | |
| 267 | def __repr__(self) -> str: |
| 268 | """Return a canonical string representation.""" |
nothing calls this directly
no test coverage detected