Skip to content

Commit c71c868

Browse files
committed
Core: yield from in collect_leaves
- use yield from in `collect_leaves` in `core.py` to iterate through children
1 parent 60a2c08 commit c71c868

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/zennit/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ def collect_leaves(module):
350350
children = module.children()
351351
for child in children:
352352
is_leaf = False
353-
for leaf in collect_leaves(child):
354-
yield leaf
353+
yield from collect_leaves(child)
355354
if is_leaf: # pragma: no branch
356355
yield module
357356

0 commit comments

Comments
 (0)