summaryrefslogtreecommitdiff
path: root/astroid/mixins.py
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2018-06-08 18:01:56 -0500
committerClaudiu Popa <pcmanticore@gmail.com>2018-06-08 16:48:50 -0700
commit3defafe124826aef4de9eef5275bcca5865b3731 (patch)
tree651a9181555ac72bdcf7ca3fad23c1f936fe7b1c /astroid/mixins.py
parent6cbfab46ba341e7e8fb8da1b6d9ce1cdd4a363c7 (diff)
downloadastroid-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.py6
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 ()