Public constructor for Nodes. This indirection got introduced in order to enable removing the fragile logic from the node constructors. Subclasses can use ``super().from_parent(...)`` when overriding the construction. :param parent: The parent node of this
(cls, parent: "Node", **kw)
| 247 | |
| 248 | @classmethod |
| 249 | def from_parent(cls, parent: "Node", **kw): |
| 250 | """Public constructor for Nodes. |
| 251 | |
| 252 | This indirection got introduced in order to enable removing |
| 253 | the fragile logic from the node constructors. |
| 254 | |
| 255 | Subclasses can use ``super().from_parent(...)`` when overriding the |
| 256 | construction. |
| 257 | |
| 258 | :param parent: The parent node of this Node. |
| 259 | """ |
| 260 | if "config" in kw: |
| 261 | raise TypeError("config is not a valid argument for from_parent") |
| 262 | if "session" in kw: |
| 263 | raise TypeError("session is not a valid argument for from_parent") |
| 264 | return cls._create(parent=parent, **kw) |
| 265 | |
| 266 | @property |
| 267 | def ihook(self): |