Setitem magic method. The __setitem__ method must be defined in the SoftLink class in order for array indexing syntax to work.
(self, key: str, value: Any)
| 313 | return self.dereference().__getitem__(key) |
| 314 | |
| 315 | def __setitem__(self, key: str, value: Any) -> None: |
| 316 | """Setitem magic method. |
| 317 | |
| 318 | The __setitem__ method must be defined in the SoftLink class |
| 319 | in order for array indexing syntax to work. |
| 320 | """ |
| 321 | if not self._v_isopen: |
| 322 | raise tb.ClosedNodeError("the node object is closed") |
| 323 | elif self.is_dangling(): |
| 324 | raise ValueError("softlink target does not exist") |
| 325 | else: |
| 326 | self.dereference().__setitem__(key, value) |
| 327 | |
| 328 | def is_dangling(self) -> bool: |
| 329 | """Return True if the link is dangling.""" |
nothing calls this directly
no test coverage detected