Commit bfd2dc74 authored by Mark Dickinson's avatar Mark Dickinson

Protect against attempts to replace PyNumber_Add with PyNumber_InPlaceAdd in builtin sum

parent a0e0f9ed
......@@ -1286,6 +1286,10 @@ class BuiltinTest(unittest.TestCase):
raise ValueError
self.assertRaises(ValueError, sum, BadSeq())
empty = []
sum(([x] for x in range(10)), empty)
self.assertEqual(empty, [])
def test_type(self):
self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment