From: Victor Stinner Date: Mon, 12 May 2014 20:35:40 +0000 (+0200) Subject: Issue #21422: Add a test to check that bool << int and bool >> int return an int X-Git-Tag: v3.5.0a1~1674^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fe1049fcbb623609c79c8f9ecc8e5ffc7cf6439;p=python Issue #21422: Add a test to check that bool << int and bool >> int return an int --- diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 13152ecf12..5f14795649 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -1235,6 +1235,13 @@ class LongTest(unittest.TestCase): for n in map(int, integers): self.assertEqual(n, 0) + def test_shift_bool(self): + # Issue #21422: ensure that bool << int and bool >> int return int + for value in (True, False): + for shift in (0, 2): + self.assertEqual(type(value << shift), int) + self.assertEqual(type(value >> shift), int) + def test_main(): support.run_unittest(LongTest)