示例#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
示例#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
示例#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)
示例#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)