summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/ast.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-02-14 18:34:11 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-02-14 18:34:11 (GMT)
commitbf6267e6f8222dc37d006961b14ef8692ec459d6 (patch)
tree5a6b63737f3cd4a3c7a2a70e80cb876c491951b2 /Lib/compiler/ast.py
parent42907790b61419882e112dab645ac1b53fd24148 (diff)
downloadcpython-bf6267e6f8222dc37d006961b14ef8692ec459d6.zip
cpython-bf6267e6f8222dc37d006961b14ef8692ec459d6.tar.gz
cpython-bf6267e6f8222dc37d006961b14ef8692ec459d6.tar.bz2
rename several of the generic attribute names for nodes. new node attrs are:
Exec: expr, locals, globals Dict: items Assert: test, fail
Diffstat (limited to 'Lib/compiler/ast.py')
-rw-r--r--Lib/compiler/ast.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py
index b6744b6..22c1b04 100644
--- a/Lib/compiler/ast.py
+++ b/Lib/compiler/ast.py
@@ -180,11 +180,11 @@ class If(Node):
class Exec(Node):
nodes['exec'] = 'Exec'
- def __init__(self, expr1, expr2, expr3):
- self.expr1 = expr1
- self.expr2 = expr2
- self.expr3 = expr3
- self._children = ('exec', expr1, expr2, expr3)
+ def __init__(self, expr, locals, globals):
+ self.expr = expr
+ self.locals = locals
+ self.globals = globals
+ self._children = ('exec', expr, locals, globals)
def __repr__(self):
return "Exec(%s,%s,%s)" % self._children[1:]
@@ -362,9 +362,9 @@ class List(Node):
class Dict(Node):
nodes['dict'] = 'Dict'
- def __init__(self, keys):
- self.keys = keys
- self._children = ('dict', keys)
+ def __init__(self, items):
+ self.items = items
+ self._children = ('dict', items)
def __repr__(self):
return "Dict(%s)" % self._children[1:]
@@ -497,10 +497,10 @@ class Slice(Node):
class Assert(Node):
nodes['assert'] = 'Assert'
- def __init__(self, expr1, expr2):
- self.expr1 = expr1
- self.expr2 = expr2
- self._children = ('assert', expr1, expr2)
+ def __init__(self, test, fail):
+ self.test = test
+ self.fail = fail
+ self._children = ('assert', test, fail)
def __repr__(self):
return "Assert(%s,%s)" % self._children[1:]