1.1 --- a/simplify.py Sat Nov 25 00:40:21 2006 +0100
1.2 +++ b/simplify.py Sat Nov 25 01:36:18 2006 +0100
1.3 @@ -277,7 +277,7 @@
1.4 results = nodes = []
1.5
1.6 # Produce something like...
1.7 - # expr.__true__() ? body
1.8 + # expr.__bool__() ? body
1.9
1.10 first = 1
1.11 for compare, stmt in if_.tests:
1.12 @@ -288,7 +288,7 @@
1.13 test=InvokeFunction(
1.14 expr=LoadAttr(
1.15 expr=self.dispatch(compare),
1.16 - name="__true__"
1.17 + name="__bool__"
1.18 ),
1.19 args=[],
1.20 star=None,
1.21 @@ -534,7 +534,7 @@
1.22
1.23 if node is not last:
1.24 nodes.append(StoreTemp(expr=expr))
1.25 - #invocation = InvokeFunction(expr=LoadAttr(expr=LoadTemp(), name="__true__"), args=[], star=None, dstar=None)
1.26 + #invocation = InvokeFunction(expr=LoadAttr(expr=LoadTemp(), name="__bool__"), args=[], star=None, dstar=None)
1.27 test = Conditional(test=self._visitNot(LoadTemp()), body=[Return(expr=LoadTemp())])
1.28 nodes.append(test)
1.29
1.30 @@ -594,7 +594,7 @@
1.31
1.32 if node is not last:
1.33 nodes.append(StoreTemp(expr=expr))
1.34 - invocation = InvokeFunction(expr=LoadAttr(expr=LoadTemp(), name="__true__"), args=[], star=None, dstar=None)
1.35 + invocation = InvokeFunction(expr=LoadAttr(expr=LoadTemp(), name="__bool__"), args=[], star=None, dstar=None)
1.36 test = Conditional(test=invocation, body=[Return(expr=LoadTemp())])
1.37 nodes.append(test)
1.38
1.39 @@ -626,7 +626,7 @@
1.40 invocation = InvokeFunction(
1.41 expr=LoadAttr(
1.42 expr=expr,
1.43 - name="__true__"
1.44 + name="__bool__"
1.45 ),
1.46 args=[],
1.47 star=None,
1.48 @@ -1195,7 +1195,7 @@
1.49 # Include a conditional statement in the subprogram.
1.50
1.51 test = Conditional(else_=[])
1.52 - test.test = InvokeFunction(expr=LoadAttr(expr=self.dispatch(while_.test), name="__true__"), args=[], star=None, dstar=None)
1.53 + test.test = InvokeFunction(expr=LoadAttr(expr=self.dispatch(while_.test), name="__bool__"), args=[], star=None, dstar=None)
1.54
1.55 # Inside the conditional, add a recursive invocation to the subprogram
1.56 # if the test condition was satisfied.