diff --git a/parso/python/tree.py b/parso/python/tree.py index c169caf..f48fae1 100644 --- a/parso/python/tree.py +++ b/parso/python/tree.py @@ -521,6 +521,9 @@ class Function(ClassOrFunc): """ def scan(children): for element in children: + if element.type in ('classdef', 'funcdef', 'lambdef'): + continue + try: nested_children = element.children except AttributeError: