(self, attrname: str, value: Any)
| 283 | return target_node.__getattr__(attrname) |
| 284 | |
| 285 | def __setattr__(self, attrname: str, value: Any) -> None: |
| 286 | |
| 287 | # set attribute of the SoftLink itself |
| 288 | if ( |
| 289 | attrname in SoftLink._link_attrnames |
| 290 | or attrname[:3] in SoftLink._link_attrprefixes |
| 291 | ): |
| 292 | object.__setattr__(self, attrname, value) |
| 293 | |
| 294 | # set attribute of the target node |
| 295 | elif not self._v_isopen: |
| 296 | raise tb.ClosedNodeError("the node object is closed") |
| 297 | elif self.is_dangling(): |
| 298 | raise ValueError("softlink target does not exist") |
| 299 | else: |
| 300 | self.dereference().__setattr__(attrname, value) |
| 301 | |
| 302 | def __getitem__(self, key: str) -> Any: |
| 303 | """Getitem magic method. |
nothing calls this directly
no test coverage detected