[Python-checkins] r75971 - python/trunk/Lib/test/test_grammar.py
benjamin.peterson
python-checkins at python.org
Sat Oct 31 04:56:16 CET 2009
Author: benjamin.peterson
Date: Sat Oct 31 04:56:15 2009
New Revision: 75971
Log:
add some checks for evaluation order with parenthesis #7210
Modified:
python/trunk/Lib/test/test_grammar.py
Modified: python/trunk/Lib/test/test_grammar.py
==============================================================================
--- python/trunk/Lib/test/test_grammar.py (original)
+++ python/trunk/Lib/test/test_grammar.py Sat Oct 31 04:56:15 2009
@@ -966,6 +966,14 @@
self.assertEqual((6 / 2 if 1 else 3), 3)
self.assertEqual((6 < 4 if 0 else 2), 2)
+ def test_paren_evaluation(self):
+ self.assertEqual(16 // (4 // 2), 8)
+ self.assertEqual((16 // 4) // 2, 2)
+ self.assertEqual(16 // 4 // 2, 2)
+ self.assertTrue(False is (2 is 3))
+ self.assertFalse((False is 2) is 3)
+ self.assertFalse(False is 2 is 3)
+
def test_main():
run_unittest(TokenTests, GrammarTests)
More information about the Python-checkins
mailing list