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

Method __getattribute__

tables/link.py:262–283  ·  view source on GitHub ↗
(self, attrname: str)

Source from the content-addressed store, hash-verified

260 return None
261
262 def __getattribute__(self, attrname: str) -> Any:
263
264 # get attribute of the SoftLink itself
265 if (
266 attrname in SoftLink._link_attrnames
267 or attrname[:3] in SoftLink._link_attrprefixes
268 ):
269 return object.__getattribute__(self, attrname)
270
271 # get attribute of the target node
272 elif not self._v_isopen:
273 raise tb.ClosedNodeError("the node object is closed")
274 elif self.is_dangling():
275 return None
276 else:
277 target_node = self.dereference()
278 try:
279 # __getattribute__() fails to get children of Groups
280 return target_node.__getattribute__(attrname)
281 except AttributeError:
282 # some node classes (e.g. Array) don't implement __getattr__()
283 return target_node.__getattr__(attrname)
284
285 def __setattr__(self, attrname: str, value: Any) -> None:
286

Callers

nothing calls this directly

Calls 3

is_danglingMethod · 0.95
dereferenceMethod · 0.95
__getattr__Method · 0.45

Tested by

no test coverage detected