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)
| 208 | |
| 209 | @classmethod |
| 210 | def from_parent(cls, parent: Node, **kw) -> Self: |
| 211 | """Public constructor for Nodes. |
| 212 | |
| 213 | This indirection got introduced in order to enable removing |
| 214 | the fragile logic from the node constructors. |
| 215 | |
| 216 | Subclasses can use ``super().from_parent(...)`` when overriding the |
| 217 | construction. |
| 218 | |
| 219 | :param parent: The parent node of this Node. |
| 220 | """ |
| 221 | if "config" in kw: |
| 222 | raise TypeError("config is not a valid argument for from_parent") |
| 223 | if "session" in kw: |
| 224 | raise TypeError("session is not a valid argument for from_parent") |
| 225 | return cls._create(parent=parent, **kw) |
| 226 | |
| 227 | @property |
| 228 | def ihook(self) -> pluggy.HookRelay: |