def siblings(self, include_self: bool = True) -> Iterator["DNode"]: n = lib.lyd_first_sibling(self.cdata) while n: if n == self.cdata: if include_self: yield self else: yield self.new(self.context, n) n = n.next
def siblings(self, include_self=True): n = lib.lyd_first_sibling(self._node) while n: if n == self._node: if include_self: yield self else: yield self.new(self.context, n) n = n.next
def first_sibling(self) -> "DNode": n = lib.lyd_first_sibling(self.cdata) if n == self.cdata: return self return self.new(self.context, n)
def first_sibling(self): n = lib.lyd_first_sibling(self._node) if n == self._node: return self return self.new(self.context, n)