Getitem magic method. The __getitem__ must be defined in the SoftLink class in order for array indexing syntax to work.
(self, key: str)
| 300 | self.dereference().__setattr__(attrname, value) |
| 301 | |
| 302 | def __getitem__(self, key: str) -> Any: |
| 303 | """Getitem magic method. |
| 304 | |
| 305 | The __getitem__ must be defined in the SoftLink class in order |
| 306 | for array indexing syntax to work. |
| 307 | """ |
| 308 | if not self._v_isopen: |
| 309 | raise tb.ClosedNodeError("the node object is closed") |
| 310 | elif self.is_dangling(): |
| 311 | raise ValueError("softlink target does not exist") |
| 312 | else: |
| 313 | return self.dereference().__getitem__(key) |
| 314 | |
| 315 | def __setitem__(self, key: str, value: Any) -> None: |
| 316 | """Setitem magic method. |
nothing calls this directly
no test coverage detected