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

Method _g_unrefnode

tables/group.py:583–610  ·  view source on GitHub ↗

Remove references to a node. Removes all references to the named node.

(self, childname: str)

Source from the content-addressed store, hash-verified

581 self._v_hidden[childname] = None # insert node
582
583 def _g_unrefnode(self, childname: str) -> None:
584 """Remove references to a node.
585
586 Removes all references to the named node.
587
588 """
589 # This can *not* be triggered because of the user.
590 assert childname in self, (
591 f"group ``{self._v_pathname}`` does not have a child node "
592 f"named ``{childname}``"
593 )
594
595 # Update members information, if needed
596 if "_v_children" in self.__dict__:
597 if childname in self._v_children:
598 # Visible node.
599 members = self.__members__
600 member_index = members.index(childname)
601 del members[member_index] # disables completion
602
603 del self._v_children[childname] # remove node
604 self._v_unknown.pop(childname, None)
605 self._v_links.pop(childname, None)
606 self._v_leaves.pop(childname, None)
607 self._v_groups.pop(childname, None)
608 else:
609 # Hidden node.
610 del self._v_hidden[childname] # remove node
611
612 def _g_move(self, newparent: Group, newname: str) -> None:
613 # Move the node to the new location.

Callers 2

_g_removeMethod · 0.80
_g_moveMethod · 0.80

Calls 2

indexMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected