Skip to content

Commit

Permalink
Improve code climate.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0fec0de committed Nov 15, 2017
1 parent 911a675 commit 733bbda
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions anytree/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ def __init__(self, node, filter_=None, stop=None, maxlevel=None):

def __init(self):
node = self.node
filter_ = self.filter_
stop = self.stop
maxlevel = self.maxlevel
if filter_ is None:
if self.filter_ is None:
def filter_(node):
return True
if stop is None:
else:
filter_ = self.filter_
if self.stop is None:
def stop(node):
return False
else:
stop = self.stop
children = [] if AbstractIter._abort_at_level(1, maxlevel) else AbstractIter._get_children([node], stop)
return self._iter(children, filter_, stop, maxlevel)

Expand Down

0 comments on commit 733bbda

Please sign in to comment.