[Python-checkins] r82346 - in python/branches/py3k: Demo/parser/test_unparse.py Demo/parser/unparse.py
mark.dickinson
python-checkins at python.org
Mon Jun 28 22:09:18 CEST 2010
Author: mark.dickinson
Date: Mon Jun 28 22:09:18 2010
New Revision: 82346
Log:
Merged revisions 82345 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82345 | mark.dickinson | 2010-06-28 20:54:19 +0100 (Mon, 28 Jun 2010) | 1 line
unparse.py: fix mispaced parentheses in chained comparisons
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Demo/parser/test_unparse.py
python/branches/py3k/Demo/parser/unparse.py
Modified: python/branches/py3k/Demo/parser/test_unparse.py
==============================================================================
--- python/branches/py3k/Demo/parser/test_unparse.py (original)
+++ python/branches/py3k/Demo/parser/test_unparse.py Mon Jun 28 22:09:18 2010
@@ -53,6 +53,10 @@
self.check_roundtrip("not True or False")
self.check_roundtrip("True or not False")
+ def test_chained_comparisons(self):
+ self.check_roundtrip("1 < 4 <= 5")
+ self.check_roundtrip("a is b is c is not d")
+
def test_main():
test.support.run_unittest(UnparseTestCase)
Modified: python/branches/py3k/Demo/parser/unparse.py
==============================================================================
--- python/branches/py3k/Demo/parser/unparse.py (original)
+++ python/branches/py3k/Demo/parser/unparse.py Mon Jun 28 22:09:18 2010
@@ -379,7 +379,7 @@
for o, e in zip(t.ops, t.comparators):
self.write(" " + self.cmpops[o.__class__.__name__] + " ")
self.dispatch(e)
- self.write(")")
+ self.write(")")
boolops = {_ast.And: 'and', _ast.Or: 'or'}
def _BoolOp(self, t):
More information about the Python-checkins
mailing list