diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-14 18:58:00 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-14 18:58:00 (GMT) |
commit | eef65908a10f9fc7f2b69e826d324a4189e4d341 (patch) | |
tree | 50282bcf12d4669cc03781be7e4df338bb240889 /Tools | |
parent | 34aeeffb62dbe8192cb520e189bb6c98572986da (diff) | |
download | cpython-eef65908a10f9fc7f2b69e826d324a4189e4d341.zip cpython-eef65908a10f9fc7f2b69e826d324a4189e4d341.tar.gz cpython-eef65908a10f9fc7f2b69e826d324a4189e4d341.tar.bz2 |
Add getChildNodes() method to Node
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/compiler/astgen.py | 2 | ||||
-rw-r--r-- | Tools/compiler/compiler/astgen.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py index c31ca54..fc92993 100644 --- a/Tools/compiler/astgen.py +++ b/Tools/compiler/astgen.py @@ -171,6 +171,8 @@ class Node: return flatten(self._getChildren()) def asList(self): return tuple(asList(self.getChildren())) + def getChildNodes(self): + return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): def __init__(self): diff --git a/Tools/compiler/compiler/astgen.py b/Tools/compiler/compiler/astgen.py index c31ca54..fc92993 100644 --- a/Tools/compiler/compiler/astgen.py +++ b/Tools/compiler/compiler/astgen.py @@ -171,6 +171,8 @@ class Node: return flatten(self._getChildren()) def asList(self): return tuple(asList(self.getChildren())) + def getChildNodes(self): + return [n for n in self.getChildnre() if isinstance(n, Node)] class EmptyNode(Node): def __init__(self): |