In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Commit bfa26ef0 authored by Eckhart Arnold's avatar Eckhart Arnold

- Default argument for 'include_root' in Node.select and .select_by_tag now False

parent d7a1433e
......@@ -595,7 +595,7 @@ class Node(collections.abc.Sized):
return self._tree_repr(' ' * indentation, opening, closing, density=1)
def select(self, match_function: Callable, include_root: bool=True) -> Iterator['Node']:
def select(self, match_function: Callable, include_root: bool=False) -> Iterator['Node']:
"""
Finds nodes in the tree that fulfill a given criterion.
......@@ -623,7 +623,7 @@ class Node(collections.abc.Sized):
def select_by_tag(self, tag_names: Union[str, AbstractSet[str]],
include_root: bool=True) -> Iterator['Node']:
include_root: bool=False) -> Iterator['Node']:
"""
Returns an iterator that runs through all descendants that have one
of the given tag names.
......
......@@ -209,7 +209,7 @@ class TestNodeFind():
assert matches[1] == parse_sxpr('(X F)')
# check default: root is included in search:
matchf2 = lambda node: match_tag_name(node, 'a')
assert list(tree.select(matchf2))
assert list(tree.select(matchf2, include_root=True))
assert not list(tree.select(matchf2, include_root=False))
def test_getitem(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment