diff options
author | Nick Drozd <nicholasdrozd@gmail.com> | 2018-06-08 18:01:56 -0500 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-08 16:48:50 -0700 |
commit | 3defafe124826aef4de9eef5275bcca5865b3731 (patch) | |
tree | 651a9181555ac72bdcf7ca3fad23c1f936fe7b1c /astroid/mixins.py | |
parent | 6cbfab46ba341e7e8fb8da1b6d9ce1cdd4a363c7 (diff) | |
download | astroid-git-3defafe124826aef4de9eef5275bcca5865b3731.tar.gz |
Add NoChildrenMixin
This allows consolidating all the empty get_children methods.
Diffstat (limited to 'astroid/mixins.py')
-rw-r--r-- | astroid/mixins.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/astroid/mixins.py b/astroid/mixins.py index 1790a4fc..fab88344 100644 --- a/astroid/mixins.py +++ b/astroid/mixins.py @@ -143,3 +143,9 @@ class MultiLineBlockMixin: for block in self._multi_line_blocks: for child_node in block: yield from child_node._get_assign_nodes() + + +class NoChildrenMixin: + """Mixin for nodes with no children, e.g. Pass.""" + def get_children(self): + yield from () |