MCPcopy Create free account
hub / github.com/PyTables/PyTables / __setattr__

Method __setattr__

tables/link.py:285–300  ·  view source on GitHub ↗
(self, attrname: str, value: Any)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

is_danglingMethod · 0.95
dereferenceMethod · 0.95

Tested by

no test coverage detected