Commit 588474ca authored by eckhart's avatar eckhart
Browse files

- cython compatibility restored

parent 7d533d69
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -16,14 +16,14 @@ cdef class Node:
    cpdef is_anonymous(self)
    cpdef is_anonymous(self)
    cpdef _content(self)
    cpdef _content(self)
    cpdef with_pos(self, pos)
    cpdef with_pos(self, pos)
    cpdef has_attr(self)
    # cpdef has_attr(self, attr)
    # cpdef compare_attr(self, other)
    # cpdef compare_attr(self, other)
    # cpdef _tree_repr(self, tab, open_fn, close_fn, data_fn, density, inline, inline_fn)
    # cpdef _tree_repr(self, tab, open_fn, close_fn, data_fn, density, inline, inline_fn)
    # cpdef as_sxpr(self, src, indentation, compact)
    # cpdef as_sxpr(self, src, indentation, compact)
    # cpdef as_xml(self, src, indentation, inline_tags, omit_tags, empty_tags)
    # cpdef as_xml(self, src, indentation, inline_tags, omit_tags, empty_tags)
    # cpdef select_if(self, match_function, include_root, reverse)
    # cpdef select_if(self, match_function, include_root, reverse)
    # cpdef select(self, tag_names, include_root)
    # cpdef select(self, tag_names, include_root)
    cpdef pick(self, tag_names)
    # cpdef pick(self, criterion, reverse)
    # cpdef tree_size(self)
    # cpdef tree_size(self)
    cpdef to_json_obj(self)
    cpdef to_json_obj(self)


+1 −2
Original line number Original line Diff line number Diff line
@@ -614,8 +614,7 @@ class Node: # (collections.abc.Sized): Base class omitted for cython-compatibil
        """
        """
        return self.select_if(create_match_function(criterion), include_root, reverse)
        return self.select_if(create_match_function(criterion), include_root, reverse)


    def pick(self, criterion: CriteriaType,
    def pick(self, criterion: CriteriaType, reverse: bool = False) -> Optional['Node']:
             reverse: bool = False) -> Optional['Node']:
        """
        """
        Picks the first (or last if run in reverse mode) descendant that fulfills
        Picks the first (or last if run in reverse mode) descendant that fulfills
        the given criterion which can be either a match-function or a tag-name or
        the given criterion which can be either a match-function or a tag-name or