Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 def first_sibling(self) -> "DNode":
     n = lib.lyd_first_sibling(self.cdata)
     if n == self.cdata:
         return self
     return self.new(self.context, n)
Exemplo n.º 4
0
 def first_sibling(self):
     n = lib.lyd_first_sibling(self._node)
     if n == self._node:
         return self
     return self.new(self.context, n)